﻿/* =========================
   ПЕРЕМЕННЫЕ / БАЗА
   Основные цвета, радиусы и базовые настройки проекта
========================= */

:root {
    --primary: #1f5c99;
    --primary-dark: #174a7c;
    --text-main: #1f2a37;
    --text-title: #173654;
    --text-soft: #607286;
    --text-muted: #6b7d8f;
    --line-soft: #dbe4ef;
    --line-medium: #d6e0ea;
    --panel-soft: #f3f7fb;
    --panel-soft-2: #edf3f9;
    --panel-light: #f8fbff;
    --radius-sm: 10px;
    --radius-md: 12px;
    --radius-lg: 14px;
    --radius-xl: 18px;
}

/* Базовый размер шрифта для всего приложения */
html {
    font-size: 14px;
}

/* Увеличение базового шрифта на больших экранах */
@media (min-width: 992px) {
    html {
        font-size: 15px;
    }
}

/* Общая основа для обычных страниц и страницы авторизации */
body.keup-body,
body.auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* Фон и цвет текста основного интерфейса */
body.keup-body {
    background: #f4f7fb;
    color: var(--text-main);
}

/* Фон страницы авторизации */
body.auth-page {
    background: linear-gradient(180deg, #0e2a47 0%, #163b61 100%);
}

/* Убирает подчеркивание у ссылок */
a,
a:hover {
    text-decoration: none;
}

/* Единый приглушенный цвет текста */
.text-muted {
    color: var(--text-soft) !important;
}


/* =========================
   ОБЩИЕ ЭЛЕМЕНТЫ
   Унификация карточек, таблиц, форм, кнопок и уведомлений
========================= */

/* Общие скругления для основных элементов интерфейса */
.card,
.table,
.form-control,
.form-select,
.account-list-empty,
.btn,
.alert {
    border-radius: var(--radius-sm);
}

/* Общий размер и внутренние отступы полей */
.form-control,
.form-select,
.account-list-empty {
    min-height: 44px;
    padding: 10px 14px;
}

    /* Подсветка активных полей ввода */
    .form-control:focus,
    .form-select:focus {
        border-color: #3f79b6;
        box-shadow: 0 0 0 0.2rem rgba(63, 121, 182, 0.18);
    }

/* Светлый фон для вспомогательных блоков */
.bg-light-subtle {
    background-color: #f7f9fc !important;
}

/* Мягкий цвет границ */
.border.rounded {
    border-color: #dbe3ed !important;
}

/* Светлое информационное уведомление */
.alert-light.border {
    background: #fafcfe;
    border-color: var(--line-soft) !important;
    color: #486175;
}


/* =========================
   КНОПКИ
   Основные кнопки приложения и кнопка выхода в шапке
========================= */

/* Основная синяя кнопка */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

    /* Состояния наведения и фокуса для основной кнопки */
    .btn-primary:hover,
    .btn-primary:focus {
        background-color: var(--primary-dark);
        border-color: var(--primary-dark);
    }

/* Зеленая кнопка для положительных действий */
.btn-success {
    background-color: #2d7b46;
    border-color: #2d7b46;
}

    /* Состояния наведения и фокуса для зеленой кнопки */
    .btn-success:hover,
    .btn-success:focus {
        background-color: #236237;
        border-color: #236237;
    }

/* Контурная кнопка в темной шапке */
.keup-outline-btn {
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: transparent;
    border-radius: var(--radius-sm);
    padding: 0.42rem 0.95rem;
    font-weight: 500;
}

    /* Инверсия цвета при наведении на кнопку в шапке */
    .keup-outline-btn:hover,
    .keup-outline-btn:focus {
        color: #12375d;
        background: #ffffff;
        border-color: #ffffff;
    }


/* =========================
   ОСНОВНОЙ МАКЕТ
   Шапка, навигация, пользовательский блок, контент и подвал
========================= */

/* Липкая верхняя шапка */
.keup-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: linear-gradient(180deg, #0e2a47 0%, #12375d 100%);
    color: #ffffff;
}

/* Верхняя часть шапки */
.keup-header-top {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

/* Название приложения */
.keup-brand-title {
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #ffffff;
}

/* Подзаголовок приложения */
.keup-brand-subtitle {
    margin-top: 2px;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.82);
}

/* Высота панели навигации */
.keup-navbar {
    min-height: 58px;
}

/* Ссылки навигации */
.keup-nav-link {
    color: rgba(255, 255, 255, 0.88) !important;
    font-weight: 500;
    padding-left: 0.9rem !important;
    padding-right: 0.9rem !important;
    border-radius: var(--radius-sm);
    transition: background-color 0.15s ease, color 0.15s ease;
}

    /* Наведение на ссылки навигации */
    .keup-nav-link:hover,
    .keup-nav-link:focus {
        background-color: rgba(255, 255, 255, 0.12);
        color: #ffffff !important;
    }

/* Блок с ФИО и ролью пользователя */
.keup-user-block {
    text-align: right;
}

/* Имя пользователя */
.keup-user-name {
    color: #ffffff;
    font-weight: 600;
    line-height: 1.15;
}

/* Роль пользователя */
.keup-user-role {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.88rem;
}

/* Основная область страницы */
.keup-main {
    min-height: calc(100vh - 172px);
}

/* Карточка основного содержимого */
.keup-content-card {
    background: #ffffff;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
}

/* Уведомления внутри основного интерфейса */
.keup-alert {
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
}

/* Подвал страницы */
.keup-footer {
    background: #eef3f8;
    border-top: 1px solid #d6e0eb;
}

/* Текст подвала */
.keup-footer-text {
    color: #4b5c70;
    font-size: 0.92rem;
}


/* =========================
   ЗАГОЛОВКИ СТРАНИЦ
   Общие стили названий разделов и подзаголовков
========================= */

/* Основные заголовки страниц */
h2,
.page-title-block h2 {
    color: var(--text-title);
    font-weight: 700;
}

/* Подпись под заголовком страницы */
.page-subtitle {
    margin-top: 2px;
    color: var(--text-muted);
}


/* =========================
   ТАБЛИЦЫ
   Базовое оформление таблиц и кастомной таблицы custom-table
========================= */

/* Вертикальное выравнивание содержимого таблиц */
.table th,
.table td {
    vertical-align: middle;
}

/* Шапка таблицы */
.table thead th {
    background: #eef4fa;
    color: #16324f;
    font-weight: 600;
    border-bottom: 1px solid #d7e2ee;
}

/* Минимальная ширина маленьких кнопок в таблицах */
.table .btn-sm {
    min-width: 90px;
}

/* Формы внутри таблиц не занимают всю строку по умолчанию */
.table form.m-0 {
    display: inline-block;
}

/* Кастомная таблица со скругленными углами */
.custom-table {
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
}

    /* Ячейки заголовка кастомной таблицы */
    .custom-table thead th {
        background: #f1f5f9;
        color: #2c3e50;
        font-weight: 600;
        padding: 14px 16px;
        border-bottom: 1px solid #dbe5ef;
    }

        /* Скругление левого верхнего угла таблицы */
        .custom-table thead th:first-child {
            border-top-left-radius: var(--radius-md);
        }

        /* Скругление правого верхнего угла таблицы */
        .custom-table thead th:last-child {
            border-top-right-radius: var(--radius-md);
        }

    /* Строки таблицы */
    .custom-table tbody tr {
        background: #ffffff;
        transition: background-color 0.15s ease;
    }

        /* Подсветка строки при наведении */
        .custom-table tbody tr:hover {
            background: #f8fbff;
        }

    /* Ячейки таблицы */
    .custom-table td {
        padding: 8px 10px;
        border-top: 1px solid #eef2f7;
    }

    /* Убирает лишние нижние границы Bootstrap */
    .custom-table.table > :not(caption) > * > * {
        border-bottom: none;
    }


/* =========================
   SVG-КНОПКИ В ТАБЛИЦАХ
========================= */

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

    .btn-icon svg {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
        stroke: currentColor;
    }

    .btn-icon .btn-text {
        line-height: 1;
    }

/* Блок действий в таблицах студентов/предметов */
.table-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 120px;
    height: 100%;
    margin: 0 auto;
}

    .table-actions form {
        display: block !important;
        width: 100%;
        margin: 0;
    }

    .table-actions .btn {
        width: 100%;
        min-width: 120px;
        min-height: 34px;
        line-height: 1;
        white-space: nowrap;
    }


/* =========================
   ДЕЙСТВИЯ В ТАБЛИЦЕ ГРУПП
========================= */

.group-edit-form {
    margin: 0;
    width: 100%;
}

    .group-edit-form .form-control {
        width: 100%;
    }

.group-actions-grid {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr);
    gap: 8px;
    width: 100%;
    min-width: 260px;
}

    .group-actions-grid form {
        display: block !important;
        width: 100%;
        margin: 0;
    }

    .group-actions-grid .btn {
        width: 100%;
        min-width: 120px;
        min-height: 34px;
        padding: 0.375rem 0.75rem;
        white-space: nowrap;
    }


/* =========================
   СТРАНИЦЫ АВТОРИЗАЦИИ
========================= */

.auth-page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.auth-card-header {
    background: var(--panel-soft);
    border-bottom: 1px solid #dbe5ef;
    padding: 22px 26px 16px;
    text-align: center;
}

.auth-card-body {
    padding: 26px 28px 22px;
}

    .auth-card-body form > * {
        margin-bottom: 16px;
    }

        .auth-card-body form > *:last-child {
            margin-bottom: 0;
        }

.auth-card .btn-lg {
    min-height: 44px;
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 1rem;
}

.auth-title {
    margin: 0 0 4px;
    color: #12375d;
    font-size: 1.55rem;
    font-weight: 700;
}

.auth-subtitle {
    margin: 0;
    color: #5c6f82;
    font-size: 0.9rem;
}

.auth-note {
    margin-top: 12px;
    text-align: center;
    color: #6b7c8f;
    font-size: 0.9rem;
    line-height: 1.45;
}

.auth-footer-link {
    margin-top: 18px;
    text-align: center;
    position: relative;
    z-index: 5;
}

    .auth-register-link,
    .auth-footer-link a {
        display: inline-block;
        color: var(--primary);
        font-weight: 600;
        text-decoration: none;
        cursor: pointer;
        pointer-events: auto;
    }

        .auth-register-link:hover,
        .auth-footer-link a:hover {
            color: var(--primary-dark);
            text-decoration: underline;
        }


/* =========================
   ВКЛАДКИ АВТОРИЗАЦИИ
========================= */

.auth-tabs {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 28px;
    padding-bottom: 0;
    border-bottom: 1px solid #e2e8f0;
}

.auth-tab-btn {
    background: transparent;
    border: none;
    color: #7a8898;
    font-size: 1.05rem;
    font-weight: 500;
    padding: 0 0 0.9rem;
    position: relative;
    transition: color 0.15s ease;
}

    .auth-tab-btn:hover,
    .auth-tab-btn.active {
        color: #12375d;
    }

    .auth-tab-btn.active {
        font-weight: 600;
    }

        .auth-tab-btn.active::after {
            content: "";
            position: absolute;
            left: 0;
            right: 0;
            bottom: -1px;
            height: 4px;
            border-radius: 4px 4px 0 0;
            background: var(--primary);
        }


/* =========================
   ФОРМЫ / ВАЛИДАЦИЯ
========================= */

.form-label.fw-semibold {
    color: #244566;
    margin-bottom: 10px;
}

.auth-validation-inline {
    display: block;
    margin-top: -8px;
    margin-bottom: 0;
}

    .auth-validation-inline:empty {
        display: none;
    }

.validation-summary-errors ul,
.validation-summary-valid ul {
    margin-bottom: 0;
    padding-left: 1.2rem;
}

.field-validation-compact {
    display: block;
    min-height: 8px;
    margin-top: 4px;
    font-size: 0.88rem;
}


/* =========================
   СПИСОК АККАУНТОВ
========================= */

.account-list {
    max-height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #ffffff;
    border: 1px solid var(--line-medium);
    border-radius: var(--radius-lg);
}

.grouped-account-list {
    padding-top: 0;
}

.account-group-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--panel-soft-2);
    color: #16324f;
    font-weight: 700;
    padding: 10px 16px;
    border-bottom: 1px solid #d9e3ee;
}

.account-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid #edf2f7;
    transition: background-color 0.15s ease;
}

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

    .account-row:hover {
        background: #f8fbff;
    }

    .account-row.selected {
        background: #eef4fa;
    }

.account-radio {
    flex: 0 0 auto;
    margin: 0;
}

.account-cell,
.account-name {
    display: block;
    color: var(--text-main);
    line-height: 1.35;
}

.account-cell {
    min-width: 0;
}

.account-name {
    font-weight: 500;
}

.account-list-empty {
    padding: 1rem;
    color: #6b7c8f;
    text-align: center;
    border: 1px solid #ced4da;
}

#teacherAccountSelect,
#studentGroupSelect,
#studentAccountSelect {
    border-radius: var(--radius-lg);
    font-weight: 500;
    color: var(--text-main);
}

.teacher-option {
    border-radius: var(--radius-sm);
}


/* =========================
   СТУДЕНТЫ
========================= */

.student-account-row .account-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.student-name,
.student-table-name {
    color: var(--text-main);
    font-weight: 500;
    line-height: 1.35;
}

.student-create-tabs {
    justify-content: flex-start;
    gap: 2rem;
    margin-bottom: 0;
}

    .student-create-tabs .student-create-tab-btn {
        font-size: 1rem;
    }

.student-inline-form {
    margin: 0;
}

    .student-inline-form .form-control-sm {
        min-height: 38px;
    }

.student-group-inline {
    color: #6b7c8f;
    font-size: 0.86rem;
}

.students-mini-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    margin-top: 6px;
}

.students-mini-list-item,
.students-group-meta {
    background: var(--panel-light);
    border: 1px solid #dce6f0;
}

.students-mini-list-item {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    line-height: 1.35;
    font-size: 0.95rem;
}

.students-group-meta {
    border-radius: var(--radius-md);
    padding: 12px 14px;
}

.students-group-meta-label {
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.students-group-meta-value {
    color: var(--text-title);
    font-size: 1rem;
    font-weight: 700;
}

.grant-rights-panel,
.revoke-rights-panel {
    transition: all 0.2s ease;
}


/* =========================
   РЕГИСТРАЦИЯ
========================= */

.register-group {
    margin-bottom: 4px;
}

.register-group-spaced {
    margin-top: 6px;
}

.register-grid {
    display: flex;
    flex-direction: column;
}


/* =========================
   ПОСЕЩАЕМОСТЬ
========================= */

.attendance-filter-card,
.attendance-class-card {
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-xl);
}

.attendance-filter-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.attendance-filter-title {
    color: var(--text-title);
    font-size: 1rem;
    font-weight: 700;
}

.alert-warning-soft {
    display: flex;
    background-color: #fef3c7;
    border: 1px solid #ffe69c;
    color: #664d03;
}

    .alert-warning-soft strong {
        font-weight: 600;
    }

    .alert-warning-soft:hover {
        color: #664d03;
        text-decoration: none;
    }

.attendance-summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.attendance-summary-item {
    min-width: 180px;
    background: var(--panel-light);
    border: 1px solid #dce6f0;
    border-radius: var(--radius-lg);
    padding: 12px 16px;
}

.attendance-summary-label,
.attendance-summary-value {
    margin-bottom: 4px;
}

.attendance-summary-label {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.attendance-summary-value {
    color: var(--text-title);
    font-size: 1rem;
    font-weight: 700;
}

.attendance-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #dbe5ef;
}

.attendance-tab-btn {
    background: #ffffff;
    border: 1px solid #d6e2ef;
    border-radius: var(--radius-md);
    color: #244566;
    padding: 10px 18px;
    font-weight: 600;
}

    .attendance-tab-btn.active {
        background: var(--primary);
        border-color: var(--primary);
        color: #ffffff;
    }

.attendance-class-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.attendance-class-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 150px;
}

.attendance-class-action-btn {
    width: 150px;
}

.attendance-class-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 10px 14px;
    background: #edf4fb;
    border-radius: var(--radius-md);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.95rem;
}

.attendance-class-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.attendance-card-title {
    color: #183958;
    font-size: 1rem;
    font-weight: 700;
}


/* =========================
   ЛЕГЕНДА ПОСЕЩАЕМОСТИ
========================= */

.attendance-legend,
.attendance-legend-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.attendance-legend {
    gap: 16px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e3ebf3;
    border-radius: var(--radius-md);
}

.attendance-legend-inline {
    min-height: 44px;
    gap: 18px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid var(--line-medium);
    border-radius: var(--radius-sm);
}

    .attendance-legend-inline span,
    .attendance-legend-item {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        color: #4f6276;
        font-size: 0.92rem;
    }

.attendance-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.attendance-dot-present {
    background: #b8c7d8;
}

.attendance-dot-n {
    background: #dc3545;
}

.attendance-dot-u {
    background: #22c55e;
}

.attendance-dot-o {
    background: #facc15;
}


/* =========================
   ТАБЛИЦА ПОСЕЩАЕМОСТИ
========================= */

.attendance-table-wrap {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e2eaf2;
    border-radius: var(--radius-lg);
}

.attendance-table thead th {
    background: var(--panel-soft);
    border-bottom: 1px solid #dbe5ef;
}

.attendance-student-name {
    color: var(--text-main);
    font-weight: 500;
}

.attendance-status-select {
    min-width: 140px;
}

.attendance-status-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    min-width: 62px;
    margin: 0 auto;
    padding: 0;
    border: 1px solid var(--line-medium);
    border-radius: var(--radius-md);
    font-weight: 700;
    transition: all 0.2s ease;
}

    .attendance-status-cell:hover {
        transform: scale(1.03);
    }

    .attendance-status-cell.status-present {
        background: #f8fbff !important;
        color: #334e68 !important;
        border-color: #cfe0f2 !important;
    }

    .attendance-status-cell.status-n {
        background: #fee2e2 !important;
        color: #991b1b !important;
        border-color: #fca5a5 !important;
    }

    .attendance-status-cell.status-u {
        background: #dcfce7 !important;
        color: #166534 !important;
        border-color: #86efac !important;
    }

    .attendance-status-cell.status-o {
        background: #fef3c7 !important;
        color: #92400e !important;
        border-color: #facc15 !important;
    }


/* =========================
   ТАБЛИЦА СТУДЕНТОВ
========================= */

.student-table {
    width: 100%;
    table-layout: fixed;
}


/* =========================
   ПОИСК ПО СТУДЕНТАМ
========================= */

.student-search-panel {
    padding: 12px;
    background: #f8fbff;
    border: 1px solid #dce6f0;
    border-radius: 14px;
}

.student-search-label {
    display: block;
    margin-bottom: 6px;
    color: #607286;
    font-size: 0.84rem;
    font-weight: 600;
}


/* =========================
   МОБИЛЬНЫЕ КАРТОЧКИ СТУДЕНТОВ
========================= */

.students-mobile-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.student-card {
    width: 100%;
    max-width: 330px;
    padding: 10px;
    background: #ffffff;
    border: 1px solid #dce6f0;
    border-radius: 14px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

    .student-card:hover {
        background: #f8fbff;
    }

    .student-card.selected {
        background: #eef4fa;
        border-color: #9fc2e6;
    }

.student-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.student-card-id {
    color: #6b7d8f;
    font-size: 0.82rem;
    font-weight: 600;
}

.student-card-select {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: #173654;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

.student-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
}

    .student-card-grid .form-control {
        min-height: 38px;
        padding: 8px 11px;
        font-size: 0.92rem;
    }

.student-card-rights {
    margin-top: 9px;
    padding: 9px;
    background: #f8fbff;
    border: 1px solid #dce6f0;
    border-radius: 12px;
}

.student-card-rights-title {
    margin-bottom: 6px;
    color: #607286;
    font-size: 0.78rem;
    font-weight: 600;
}

.student-rights-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
}

.student-rights-text {
    color: #1f2a37;
    font-size: 0.9rem;
}

.student-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 9px;
}

    .student-card-actions form,
    .student-card-actions .btn {
        width: 100%;
    }

/* =========================
   ПРАВА В МОБИЛЬНОЙ КАРТОЧКЕ СТУДЕНТА
========================= */

.student-rights-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .student-rights-form .form-control {
        min-height: 38px;
        padding: 8px 11px;
        font-size: 0.9rem;
    }

.student-card-actions .btn-icon {
    min-height: 36px;
}


/* =========================
   ПАНЕЛЬ СОХРАНЕНИЯ ПОСЕЩАЕМОСТИ
========================= */

.attendance-save-panel {
    position: fixed;
    left: 50%;
    bottom: 22px;
    z-index: 1050;
    width: min(720px, calc(100% - 32px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    background: #ffffff;
    border: 1px solid #cfe0f2;
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(14, 42, 71, 0.22);
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
    transition: transform 0.28s ease, opacity 0.28s ease, box-shadow 0.28s ease;
}

    /* Скрытое состояние панели */
    .attendance-save-panel.d-none {
        display: flex !important;
        opacity: 0;
        pointer-events: none;
        transform: translate(-50%, 24px);
    }

/* Текст панели */
.attendance-save-panel-text {
    color: #173654;
    font-weight: 700;
}

    .attendance-save-panel-text::before {
        content: "●";
        margin-right: 8px;
        color: var(--primary);
    }


/* =========================
   ОТЧЕТЫ
========================= */

.report-preview-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #dbe5ef;
}

.report-preview-meta {
    color: #57697c;
    line-height: 1.6;
}

.report-subject-check {
    min-height: 48px;
    padding: 12px 14px;
    background: var(--panel-light);
    border: 1px solid #dce6f0;
    border-radius: var(--radius-md);
    color: var(--text-main);
    cursor: pointer;
}

    .report-subject-check:hover {
        background: #eef4fa;
    }

.report-row-warning > td {
    background: #fef3c7 !important;
}

.report-row-danger > td {
    background: #fee2e2 !important;
}


/* =========================
   АДАПТИВ ДО 992PX
========================= */

@media (max-width: 991.98px) {

    .keup-content-card {
        padding: 1rem;
        border-radius: var(--radius-lg);
    }

    .keup-brand-title {
        font-size: 1.3rem;
    }

    .keup-brand-subtitle {
        font-size: 0.82rem;
    }

    .auth-card-body {
        padding: 24px 22px 22px;
    }

    .auth-title {
        font-size: 1.45rem;
    }

    .attendance-class-actions,
    .attendance-class-action-btn {
        width: 100%;
    }
}


/* =========================
   АДАПТИВ ДО 768PX
========================= */

@media (max-width: 767.98px) {

    .attendance-class-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .attendance-class-badge {
        min-width: auto;
    }

    .attendance-summary-item {
        width: 100%;
        min-width: unset;
    }

    .attendance-legend {
        gap: 10px;
    }

    .attendance-save-panel {
        left: 12px;
        right: 12px;
        bottom: 14px;
        width: auto;
        transform: translateY(0);
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

        .attendance-save-panel.d-none {
            transform: translateY(24px);
        }

        .attendance-save-panel .btn {
            width: 100%;
        }

    .keup-header {
        padding: 0;
    }

        .keup-header .container,
        .keup-main .container {
            padding-left: 16px;
            padding-right: 16px;
        }

    .keup-header-top {
        padding-top: 18px;
        padding-bottom: 14px;
    }

    .keup-brand-title {
        font-size: 1.2rem;
        line-height: 1.25;
    }

    .keup-brand-subtitle {
        margin-top: 4px;
        font-size: 0.82rem;
        line-height: 1.35;
    }

    .keup-navbar {
        min-height: auto;
        padding: 12px;
    }

        .keup-navbar .navbar-toggler {
            width: 46px;
            height: 46px;
            padding: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 14px;
            border: 1px solid rgba(255, 255, 255, 0.35);
            background: rgba(255, 255, 255, 0.08);
            box-shadow: none;
        }

            .keup-navbar .navbar-toggler:focus {
                box-shadow: 0 0 0 0.18rem rgba(255, 255, 255, 0.18);
            }

        .keup-navbar .navbar-toggler-icon {
            width: 24px;
            height: 24px;
            margin: 0;
            background-size: 24px 24px;
            background-position: center;
        }

        .keup-navbar .navbar-collapse {
            padding: 0;
            border: none;
            background: transparent;
        }

        .keup-navbar .navbar-nav {
            gap: 4px;
        }

    .keup-nav-link {
        display: block;
        padding: 9px 12px !important;
        border-radius: 10px;
        background: transparent;
        color: rgba(255, 255, 255, 0.9) !important;
    }

        .keup-nav-link:hover,
        .keup-nav-link:focus {
            background: rgba(255, 255, 255, 0.1);
            color: #ffffff !important;
        }

    .keup-user-block {
        width: 100%;
        margin: 12px 0;
        padding-top: 12px;
        text-align: left;
        border-top: 1px solid rgba(255, 255, 255, 0.14);
    }

    .keup-user-name {
        font-size: 0.94rem;
        line-height: 1.3;
    }

    .keup-user-role {
        margin-top: 2px;
        font-size: 0.82rem;
    }

    .keup-outline-btn {
        width: 100%;
        padding: 9px 14px;
        border-radius: 10px;
        text-align: center;
        background: transparent;
    }

        .keup-outline-btn:hover,
        .keup-outline-btn:focus {
            color: #12375d;
            background: #ffffff;
        }

    .keup-content-card {
        padding: 1rem;
        border-radius: 16px;
    }
}


/* =========================
   АДАПТИВ ДО 576PX
========================= */

@media (max-width: 575.98px) {

    .custom-table td,
    .custom-table th {
        padding: 8px 6px;
    }

    .group-actions-grid {
        grid-template-columns: 38px 38px;
        justify-content: center;
        justify-items: center;
        align-items: center;
        gap: 6px;
        width: 82px;
        min-width: 82px;
        margin: 0 auto;
    }

    /* Фиксируем ширину колонки "Действия" */
    .table th:last-child,
    .table td:last-child {
        width: 110px;
        max-width: 110px;
        white-space: nowrap;
    }

        .group-actions-grid form {
            width: 38px;
        }

        .group-actions-grid .btn {
            width: 38px !important;
            min-width: 38px !important;
            max-width: 38px !important;
            height: 38px !important;
            min-height: 38px !important;
            padding: 0 !important;
            border-radius: 10px;
            gap: 0 !important;
        }

        .group-actions-grid .btn-text {
            display: none !important;
        }

        .group-actions-grid svg {
            width: 17px;
            height: 17px;
        }

    .table .btn-sm {
        min-width: 0;
    }

    .role-switcher {
        grid-template-columns: 1fr;
    }

    .auth-page-wrapper {
        padding: 16px;
    }

    .auth-card-header {
        padding: 22px 18px 18px;
    }

    .auth-card-body {
        padding: 20px 18px 18px;
    }

    .auth-tabs {
        gap: 20px;
    }

    .account-row {
        padding: 12px 14px;
    }

    .account-group-header {
        padding: 9px 14px;
    }

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

    .register-grid-full {
        grid-column: auto;
    }

    .register-group-spaced {
        margin-top: 8px;
    }

    .keup-content-card {
        padding: 0.85rem;
    }

    .table-actions {
        width: 38px;
        height: 100%;
        margin: 0 auto;
        align-items: center;
        justify-content: center;
    }

        .table-actions .btn {
            width: 38px;
            min-width: 38px;
            height: 34px;
            min-height: 34px;
            padding: 0;
            gap: 0;
        }

        .btn-icon-mobile-compact .btn-text,
        .table-actions .btn-text,
        .group-actions-grid .btn-text {
            display: none !important;
        }

        .btn-icon-mobile-compact svg,
        .table-actions svg,
        .group-actions-grid svg {
            width: 17px;
            height: 17px;
        }
}
