/* ===== MODERN STYLE - Единый стиль для всех представлений ===== */

/* ===== APP SPOILER (collapse + chevron) ===== */
.app-spoiler-toggle {
    cursor: pointer;
    color: inherit;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease;
}

.app-spoiler-toggle:hover {
    color: var(--bs-primary);
}

.app-spoiler-toggle:focus {
    outline: none;
}

.app-spoiler-toggle:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

.app-spoiler-title {
    font-size: 1rem;
    font-weight: 600;
}

.app-spoiler-title .fas,
.app-spoiler-title .far {
    font-size: 0.9rem;
}

.app-spoiler-chevron {
    font-size: 0.875rem;
    opacity: 0.75;
    transition: transform 0.25s ease;
}

.app-spoiler-toggle:not(.collapsed) .app-spoiler-chevron {
    transform: rotate(180deg);
}

html[data-theme="dark"] .app-spoiler-toggle:hover {
    color: var(--bs-primary);
}

/* ===== NAVIGATION CARDS ===== */
.nav-card {
    border-radius: 12px !important;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

.nav-card .card-body {
    transition: all 0.3s ease;
    min-height: 100px;
}

.nav-card:hover .card-body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
}

@media (max-width: 991.98px) {
    .nav-tiles-row {
        --bs-gutter-x: 0.35rem;
        --bs-gutter-y: 0.35rem;
    }
    .nav-card {
        aspect-ratio: 1;
    }
    .nav-card .card-body {
        min-height: 0 !important;
    }

    .dashboard-page .nav-tiles-row > [class*="col"] > a {
        display: block;
        height: 100%;
    }

    .dashboard-page .nav-tiles-row .nav-card,
    .dashboard-page .nav-tiles-row .nav-card.h-100 {
        aspect-ratio: 1 / 1 !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none;
    }

    .dashboard-page .nav-tiles-row .nav-card .card-body,
    .dashboard-page .nav-tiles-row .nav-card .teacher-nav-tile-body,
    .dashboard-page .nav-tiles-row .nav-card .student-nav-tile-body {
        min-height: 0 !important;
        height: 100%;
        padding: clamp(0.3rem, 6cqi, 0.55rem) clamp(0.15rem, 4cqi, 0.35rem) !important;
        container-type: inline-size;
    }

    .dashboard-page .nav-tiles-row .nav-icon-large {
        font-size: clamp(1.55rem, 32cqi, 2.65rem);
        margin-bottom: clamp(0.15rem, 4cqi, 0.4rem);
    }

    .dashboard-page .nav-tiles-row .nav-title {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
        text-align: center;
        font-size: clamp(0.62rem, 16cqi, 0.95rem);
        line-height: 1.15;
        white-space: nowrap;
        overflow: hidden;
        overflow-wrap: normal;
        word-break: keep-all;
    }

    .dashboard-page .teacher-nav-tiles.teacher-nav-tiles .teacher-tile-1 { order: 1; }
    .dashboard-page .teacher-nav-tiles.teacher-nav-tiles .teacher-tile-2 { order: 2; }
    .dashboard-page .teacher-nav-tiles.teacher-nav-tiles .teacher-tile-3 { order: 3; }
    .dashboard-page .teacher-nav-tiles.teacher-nav-tiles .teacher-tile-4 { order: 4; }
    .dashboard-page .teacher-nav-tiles.teacher-nav-tiles .teacher-tile-5 { order: 5; }
    .dashboard-page .teacher-nav-tiles.teacher-nav-tiles .teacher-tile-6 { order: 6; }
    .dashboard-page .teacher-nav-tiles.teacher-nav-tiles .teacher-tile-7 { order: 7; }
    .dashboard-page .teacher-nav-tiles.teacher-nav-tiles .teacher-tile-8 { order: 8; }
    .dashboard-page .teacher-nav-tiles.teacher-nav-tiles .teacher-tile-9 { order: 9; }
    .dashboard-page .teacher-nav-tiles.teacher-nav-tiles .teacher-tile-10 { order: 10; }
    .dashboard-page .teacher-nav-tiles.teacher-nav-tiles .teacher-tile-11 { order: 11; }
    .dashboard-page .teacher-nav-tiles.teacher-nav-tiles .teacher-tile-12 { order: 12; }
    .dashboard-page .student-nav-tiles.student-nav-tiles .student-tile-1 { order: 1; }
    .dashboard-page .student-nav-tiles.student-nav-tiles .student-tile-2 { order: 2; }
    .dashboard-page .student-nav-tiles.student-nav-tiles .student-tile-3 { order: 3; }
    .dashboard-page .student-nav-tiles.student-nav-tiles .student-tile-4 { order: 4; }
    .dashboard-page .student-nav-tiles.student-nav-tiles .student-tile-5 { order: 5; }
    .dashboard-page .student-nav-tiles.student-nav-tiles .student-tile-6 { order: 6; }
    .dashboard-page .student-nav-tiles.student-nav-tiles .student-tile-7 { order: 7; }
    .dashboard-page .student-nav-tiles.student-nav-tiles .student-tile-8 { order: 8; }
    .dashboard-page .student-nav-tiles.student-nav-tiles .student-tile-9 { order: 9; }
    .dashboard-page .student-nav-tiles.student-nav-tiles .student-tile-10 { order: 10; }
    .dashboard-page .student-nav-tiles.student-nav-tiles .student-tile-11 { order: 11; }
}

.dashboard-page .nav-card .card-body,
.dashboard-page .nav-card .card-body.p-3 {
    padding: 0.2rem 0.35rem !important;
    padding-top: 0.2rem !important;
    padding-bottom: 0.2rem !important;
    padding-left: 0.35rem !important;
    padding-right: 0.35rem !important;
}
.dashboard-page .welcome-card .card-body,
.dashboard-page .welcome-card .card-body.p-3 {
    padding: 0.2rem 0.5rem !important;
    padding-top: 0.2rem !important;
    padding-bottom: 0.2rem !important;
}
.dashboard-page .modern-card .card-header,
.dashboard-page .card.modern-card > .modern-card-header {
    padding: 0.2rem 0.5rem !important;
    padding-top: 0.2rem !important;
    padding-bottom: 0.2rem !important;
}

.student-dashboard .card.modern-card > .card-header.modern-card-header[data-bs-toggle="collapse"] {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    min-height: 2.75rem;
}

.student-dashboard .card.modern-card > .card-header.modern-card-header:not([data-bs-toggle="collapse"]) {
    min-height: 2.75rem;
    display: flex;
    align-items: center;
}
.student-dashboard .card.modern-card > .card-header.modern-card-header:not([data-bs-toggle="collapse"]) .modern-card-title {
    margin-bottom: 0;
    width: 100%;
}
.dashboard-page .modern-card .card-body,
.dashboard-page .modern-card .modern-card-body,
.dashboard-page .modern-card .card-body.p-3,
.dashboard-page .modern-card .modern-card-body.p-3 {
    padding: 0.2rem 0.5rem !important;
    padding-top: 0.2rem !important;
    padding-bottom: 0.2rem !important;
}
.dashboard-page .card.border-0.shadow-sm .card-body,
.dashboard-page .card.border-0.shadow-sm .card-body.p-3 {
    padding: 0.2rem 0.5rem !important;
    padding-top: 0.2rem !important;
    padding-bottom: 0.2rem !important;
}

@media (min-width: 992px) {
    .dashboard-page .nav-tiles-row .nav-card {
        min-height: 6.5rem !important;
        aspect-ratio: unset !important;
        height: auto !important;
    }
    .dashboard-page .nav-tiles-row .nav-card .card-body {
        min-height: 5.8rem !important;
    }
}

@media (max-width: 991.98px) {
    .dashboard-page .nav-tiles-row .nav-card,
    .dashboard-page .nav-tiles-row .nav-card.h-100 {
        aspect-ratio: 1 / 1 !important;
        min-height: 0 !important;
        height: auto !important;
    }
    .dashboard-page .nav-tiles-row .nav-card .card-body {
        min-height: 0 !important;
    }

    .dashboard-page .mb-4,
    .dashboard-page .nav-tiles-row {
        margin-bottom: 0.5rem !important;
    }
}

@media (min-width: 992px) {
    .dashboard-page .mb-4,
    .dashboard-page .nav-tiles-row,
    .dashboard-page .row.mb-4 {
        margin-bottom: 0.5rem !important;
    }
    .dashboard-page .nav-tiles-row {
        --bs-gutter-x: 0.35rem;
        --bs-gutter-y: 0.35rem;
    }
}

/* ===== STATISTIC CARDS ===== */
.stat-card {
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.stat-card .card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
}

.stat-card.stat-card-pink {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.15) 0%, rgba(245, 87, 108, 0.15) 100%);
    border-left-color: #f5576c;
}

.stat-card.stat-card-blue {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.15) 0%, rgba(0, 242, 254, 0.15) 100%);
    border-left-color: #4facfe;
}

.stat-card.stat-card-green {
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.15) 0%, rgba(56, 249, 215, 0.15) 100%);
    border-left-color: #43e97b;
}

.stat-card-icon {
    font-size: 1rem;
    color: #667eea;
    margin-bottom: 0;
}

.stat-card-icon.stat-icon-pink {
    color: #f5576c;
}

.stat-card-icon.stat-icon-blue {
    color: #4facfe;
}

.stat-card-icon.stat-icon-green {
    color: #43e97b;
}

.stat-card-value {
    font-size: 1.25rem;
    color: #2d3748;
    line-height: 1.2;
    font-weight: bold;
}

.stat-card-value-small {
    font-size: 0.9rem;
}

.stat-card-value-small-line {
    font-size: 0.9rem;
    line-height: 1.2;
}

.stat-card-label {
    font-size: 0.7rem;
    color: #6c757d;
}

/* ===== GRADIENT ICONS ===== */
.gradient-icon-purple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-icon-pink {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-icon-blue {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-icon-blue-alt {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-icon-green {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-icon-yellow {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-icon-teal {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-icon-gold {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.achievement-shelf-icon {
    font-size: 1.5rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
}

/* ===== NAVIGATION ICONS ===== */
.nav-icon-large {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.nav-title {
    color: #2d3748;
    font-size: clamp(0.65rem, 2.5vw, 1rem);
    font-weight: bold;
}

/* Ссылка на уведомления MAX в шапке приветствия (иконка бренда) */
.welcome-max-notify-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    text-decoration: none;
    padding: 0.2rem;
    border-radius: 10px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.welcome-max-notify-link:hover {
    opacity: 0.9;
    transform: scale(1.06);
}

.welcome-max-notify-icon {
    width: 32px;
    height: 32px;
    display: block;
    vertical-align: middle;
}

/* ===== WELCOME CARD ===== */
.welcome-card {
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.welcome-card.welcome-card-home {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
}

.welcome-card-home hr {
    border-color: rgba(102, 126, 234, 0.3);
}

.welcome-icon {
    font-size: 2.5rem;
}

.welcome-icon.welcome-icon-home {
    font-size: 4rem;
}

.welcome-logo {
    display: flex;
    justify-content: center;
}
.welcome-logo .navbar-logo {
    height: 96px;
    width: auto;
}

.welcome-title {
    color: #2d3748;
    font-size: clamp(1.05rem, 0.85rem + 1.1vw, 1.5rem);
    font-weight: bold;
    margin-bottom: 0.25rem;
    line-height: 1.25;
}

.welcome-title.welcome-title-home {
    font-size: 2.5rem;
}

.welcome-subtitle {
    color: #6c757d;
    font-size: 0.9rem;
}

.welcome-subtitle.welcome-subtitle-home {
    font-size: 1.2rem;
}

.welcome-achievement-block {
    background: rgba(255, 255, 255, 0.6);
}

.welcome-profile-photo-ring {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
}

.welcome-profile-photo-img {
    width: 56px;
    height: 56px;
    display: block;
}

.welcome-profile-link {
    display: inline-flex;
    border-radius: 50%;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.welcome-profile-link:hover {
    transform: scale(1.04);
    opacity: 0.92;
}

.welcome-profile-link:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 3px;
}

.profile-avatar-shell {
    padding: 3px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35);
}

.profile-avatar-photo {
    width: 128px;
    height: 128px;
    display: block;
    border: 2px solid #fff;
}

.profile-avatar-initials {
    width: 128px;
    height: 128px;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid rgba(255, 255, 255, 0.85);
}

.profile-photo-actions .btn.modern-btn-outline {
    white-space: nowrap;
}

/* ===== PROFILE PAGE (компактная вёрстка Account/Profile) ===== */
.profile-page .page-header {
    margin-bottom: 0.75rem;
}

.profile-page-hero {
    border-left: 4px solid rgba(102, 126, 234, 0.45);
}

.profile-page .profile-page-sidebar .profile-avatar-photo,
.profile-page .profile-page-sidebar .profile-page-avatar {
    width: 112px;
    height: 112px;
}

.profile-page .profile-page-sidebar .profile-avatar-initials,
.profile-page .profile-page-sidebar .profile-page-initials {
    width: 112px;
    height: 112px;
    font-size: 2.15rem;
}

@media (min-width: 992px) {
    .profile-page-sidebar-col {
        position: sticky;
        top: 1rem;
        align-self: flex-start;
    }
}

.profile-page .profile-avatar-shell {
    padding: 2px;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.28);
}

.profile-page .profile-avatar-photo,
.profile-page .profile-page-avatar {
    width: 96px;
    height: 96px;
}

.profile-page .profile-avatar-initials,
.profile-page .profile-page-initials {
    width: 96px;
    height: 96px;
    font-size: 2rem;
}

.profile-page-card-head {
    border-bottom: 1px solid rgba(102, 126, 234, 0.12);
}

.profile-page .profile-kv {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.875rem;
}

.profile-page .profile-k {
    color: #6c757d;
    flex-shrink: 0;
    font-weight: 500;
}

.profile-page .profile-v {
    color: #2d3748;
    text-align: right;
    word-break: break-word;
    min-width: 0;
}

.profile-subject-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35em 0.55em;
}

.profile-page-actions-inline {
    border-left: 3px solid rgba(102, 126, 234, 0.35);
}

.profile-page-tabs-card {
    border-left: 4px solid rgba(102, 126, 234, 0.45);
}

.profile-page-tabs-card .profile-page-card-head {
    border-bottom: none;
    padding-bottom: 0;
}

.profile-page-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.15rem;
    scrollbar-width: thin;
}

.profile-page-nav .nav-link {
    color: #6c757d;
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid transparent;
}

.profile-page-nav .nav-link:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.08);
}

.profile-page-nav .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
}

.profile-page-nav .nav-link i {
    font-size: 0.95rem;
}

.profile-page-tab-content {
    padding-top: 1rem;
}

.profile-page .validation-summary-valid {
    display: none;
}

.profile-page-fields-col {
    min-width: 0;
}

.profile-page-photo-col {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.profile-page-photo-col .profile-page-photo-panel {
    width: 100%;
}

.profile-page-photo-panel {
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: 0.5rem;
    background: rgba(102, 126, 234, 0.04);
    padding: 0.55rem;
}

.profile-page-photo-thumb {
    width: 100%;
    max-width: 180px;
    max-height: 180px;
    object-fit: cover;
}

.profile-page-photo-empty {
    border: 1px dashed rgba(102, 126, 234, 0.28);
    border-radius: 0.5rem;
    padding: 0.85rem 0.5rem;
}

@media (min-width: 768px) {
    .profile-page-anketa-row {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 0.75rem;
    }

    .profile-page-anketa-row > .profile-page-fields-col {
        flex: 0 0 calc(70% - var(--bs-gutter-x) * 0.3);
        max-width: calc(70% - var(--bs-gutter-x) * 0.3);
    }

    .profile-page-anketa-row > .profile-page-photo-col {
        flex: 0 0 calc(30% - var(--bs-gutter-x) * 0.7);
        max-width: calc(30% - var(--bs-gutter-x) * 0.7);
    }

    .profile-page-photo-col .profile-page-photo-panel {
        flex: 1 1 auto;
    }

    .profile-page-photo-col .profile-page-photo-thumb {
        display: block;
        width: 100%;
        max-width: none;
        aspect-ratio: 5 / 4;
        object-fit: cover;
        max-height: none;
    }

    .profile-page-photo-col .profile-page-photo-empty {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 767.98px) {
    .profile-page-photo-panel {
        margin-bottom: 0.15rem;
    }

    .profile-page-photo-thumb {
        max-width: 160px;
        max-height: 160px;
    }

    .profile-page-photo-col {
        align-items: center;
    }

    .profile-page-photo-col .profile-page-photo-panel {
        max-width: 16.5rem;
        width: 100%;
    }

    .profile-page-photo-col .profile-page-photo-thumb {
        width: 100%;
        max-width: 12.75rem;
        max-height: 12.75rem;
        aspect-ratio: 1;
        margin-left: auto;
        margin-right: auto;
    }

    .profile-page-photo-col .profile-page-photo-empty {
        width: 100%;
        max-width: 12.75rem;
        margin-left: auto;
        margin-right: auto;
    }

    .profile-page-photo-panel .btn.btn-outline-danger {
        display: block;
        margin-left: auto;
        margin-right: auto;
    }
}

.welcome-nav-row {
    align-items: flex-start;
}
.welcome-nav-row .nav-card {
    height: auto !important;
}

@media (max-width: 768px) {
    .welcome-nav-row .nav-card {
        aspect-ratio: unset !important;
    }
    .welcome-nav-row .nav-card .card-body {
        min-height: 0 !important;
    }
}

@media (max-width: 991.98px) {
    .welcome-card .welcome-title {
        font-size: clamp(1.05rem, 0.9rem + 0.8vw, 1.35rem);
    }
    .welcome-card .welcome-subtitle {
        font-size: clamp(0.75rem, 0.7rem + 0.25vw, 0.9rem);
    }
    .welcome-card .welcome-icon {
        font-size: clamp(1.75rem, 1.5rem + 1vw, 2.25rem);
    }
    .welcome-card-home .welcome-title-home {
        font-size: 1.65rem;
    }
    .welcome-card-home .welcome-subtitle-home {
        font-size: 1.2rem;
    }
}

/* ===== ELEVATION (таблицы и карточки с данными) ===== */
:root {
    --modern-elev-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
    --modern-elev-shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
    --modern-elev-shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.1), 0 4px 12px rgba(15, 23, 42, 0.06);
    --modern-elev-border: 1px solid rgba(15, 23, 42, 0.06);
    --modern-elev-surface: #ffffff;
    --modern-elev-surface-muted: #f8fafc;
    --modern-elev-accent: #667eea;
}

/* ===== LIST TOOLBAR (счётчик + поиск, эталон Class) ===== */
.modern-list-toolbar h6 {
    color: #334155;
    font-weight: 600;
}

.modern-list-search {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--modern-elev-shadow-sm);
    border: var(--modern-elev-border);
    background: var(--modern-elev-surface);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.modern-list-search:focus-within {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.14), var(--modern-elev-shadow-md);
    border-color: rgba(102, 126, 234, 0.35);
}

.modern-list-search .input-group-text {
    border: 0;
    background: var(--modern-elev-surface-muted);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.modern-list-search .form-control {
    border: 0;
    background: var(--modern-elev-surface);
    box-shadow: none;
}

.modern-list-search .form-control:focus {
    box-shadow: none;
}

.modern-list-search .form-select {
    border: 0;
    background: var(--modern-elev-surface);
    box-shadow: none;
    cursor: pointer;
}

.modern-list-search .form-select:focus {
    box-shadow: none;
}

.modern-list-search-select-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    width: 1%;
}

.admin-users-page-size-group {
    width: auto !important;
    flex: 0 0 auto !important;
    flex-wrap: nowrap !important;
    max-width: max-content;
}

.admin-users-page-size-group .modern-list-search-select-wrap {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 4.25rem;
}

.admin-users-page-size-group .modern-list-search-select-wrap .form-select {
    min-width: 4.25rem;
    width: auto !important;
}

.modern-table-pager-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap !important;
    flex: 0 0 auto;
    width: max-content;
    max-width: 100%;
    margin-left: auto;
}

.modern-table-pager-controls > nav,
.modern-table-pager-controls > .admin-users-page-size-group {
    flex: 0 0 auto;
}

.modern-list-search-select-wrap .form-select {
    width: 100%;
    padding-right: 2rem;
    background-image: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.modern-list-search-select-wrap .modern-list-search-select-chevron {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #94a3b8;
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.modern-list-search-select-wrap.is-open .modern-list-search-select-chevron {
    transform: translateY(-50%) rotate(180deg);
}

.modern-list-search .modern-list-search-clear {
    border: 0;
    background: var(--modern-elev-surface-muted);
    color: #94a3b8;
    padding: 0 0.75rem;
    line-height: 1;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.modern-list-search .modern-list-search-clear:hover {
    color: #64748b;
    background: #e2e8f0;
}

.modern-list-search .modern-list-search-clear[hidden] {
    display: none !important;
}

html[data-theme="dark"] .modern-list-search .modern-list-search-clear {
    color: #94a3b8;
    background: var(--modern-elev-surface-muted);
}

html[data-theme="dark"] .modern-list-search .modern-list-search-clear:hover {
    color: #e2e8f0;
    background: #334155;
}

/* Сортируемые заголовки (колонка «Ученик» и др.) */
table thead th.sortable {
    cursor: pointer;
    user-select: none;
}

table thead th.sortable:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

html[data-theme="dark"] table thead th.sortable:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .modern-list-toolbar h6 {
    color: #e2e8f0;
}

html[data-theme="dark"] .modern-list-search .input-group-text {
    background: var(--modern-elev-surface-muted);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .modern-list-search .form-control {
    background: var(--modern-elev-surface);
    color: #e2e8f0;
}

html[data-theme="dark"] .modern-list-search .form-select {
    background: var(--modern-elev-surface);
    color: #e2e8f0;
}

html[data-theme="dark"] .modern-list-search-select-wrap .modern-list-search-select-chevron {
    color: #94a3b8;
}

/* ===== MODERN CARDS ===== */
.modern-card {
    border-radius: 12px;
    border: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.modern-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.modern-card:has(.modern-table) {
    border-radius: 14px;
    border: var(--modern-elev-border);
    background: var(--modern-elev-surface);
    box-shadow: var(--modern-elev-shadow-lg);
    overflow: hidden;
}

.modern-card:has(.modern-table):hover {
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12), 0 6px 16px rgba(15, 23, 42, 0.06);
}

.modern-card-header {
    background: white;
    border: 0;
    border-radius: 12px 12px 0 0;
    padding-bottom: 0.5rem;
}

.modern-card-header.trainer-card-header-purple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}
.modern-card-header.trainer-card-header-orange {
    background: linear-gradient(135deg, #ff9800 0%, #ffc107 100%);
    color: white;
}

.modern-card-title {
    color: #2d3748;
    font-weight: bold;
    margin-bottom: 0;
}

/* ===== MODERN TABLES ===== */
.modern-table {
    font-size: 0.9rem;
}

.modern-table thead tr {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
    position: relative;
    z-index: 2;
}

.modern-table thead th {
    padding: 0.9rem 0.75rem;
    font-weight: 600;
    color: #475569;
    border-bottom: none;
    white-space: nowrap;
    letter-spacing: 0.01em;
    box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.06);
}

.modern-table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
}

table td,
table th {
    hyphens: none;
    -webkit-hyphens: none;
    -moz-hyphens: none;
    -ms-hyphens: none;
}

.modern-table tbody tr {
    background: var(--modern-elev-surface);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.modern-table:not(.table-bordered) tbody tr:not(:last-child) td {
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

.modern-table tbody tr:hover {
    background: #fff !important;
    box-shadow: inset 3px 0 0 var(--modern-elev-accent), 0 4px 16px rgba(102, 126, 234, 0.1);
    position: relative;
    z-index: 1;
}

.modern-table tbody tr.table-secondary {
    background: var(--modern-elev-surface-muted);
}

.modern-table tbody tr.table-secondary:hover {
    background: #f1f5f9 !important;
    box-shadow: inset 3px 0 0 #94a3b8, 0 4px 14px rgba(15, 23, 42, 0.08);
}

.modern-table .badge {
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.modern-table .badge-modern-primary,
.modern-table .badge-modern-info,
.modern-table .badge-modern-success,
.modern-table .badge-modern-secondary,
.modern-table .badge-modern-warning,
.modern-table .badge-modern-danger {
    border-radius: 8px;
}

.modern-table .badge-modern-primary {
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.2);
}

/* Кнопки действий в ячейках таблицы */
.modern-table td .btn-modern-outline-primary,
.modern-table td .btn-modern-outline-info,
.modern-table td .btn-modern-outline-success,
.modern-table td .btn-modern-outline-warning,
.modern-table td .btn-modern-outline-danger,
.modern-table td .btn-modern-outline-secondary,
.modern-table td .btn-modern-outline-warning-calm {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-color: #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.04);
}

.modern-table td .btn-modern-outline-primary:hover,
.modern-table td .btn-modern-outline-info:hover,
.modern-table td .btn-modern-outline-success:hover,
.modern-table td .btn-modern-outline-warning:hover,
.modern-table td .btn-modern-outline-danger:hover,
.modern-table td .btn-modern-outline-secondary:hover,
.modern-table td .btn-modern-outline-warning-calm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12), 0 2px 4px rgba(15, 23, 42, 0.06);
}

.modern-table td .btn-modern-outline-info:hover {
    border-color: #38bdf8;
    background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
}

.modern-table td .btn-modern-outline-success:hover {
    border-color: #4ade80;
    background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
}

.modern-table td .btn-modern-outline-primary:hover {
    border-color: #a5b4fc;
    background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
}

.modern-table td .btn-modern-outline-warning:hover,
.modern-table td .btn-modern-outline-warning-calm:hover {
    border-color: #fbbf24;
    background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
}

.modern-table td .btn-modern-outline-danger:hover {
    border-color: #f87171;
    background: linear-gradient(180deg, #fef2f2 0%, #fee2e2 100%);
}

.modern-table td .btn:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.1);
}

/* ===== STUDENT MANAGEMENT TABLE HEADERS ===== */
.modern-table thead th.th-school-class {
    min-width: 120px;
}

.modern-table thead th.th-online-class {
    min-width: 130px;
}

.modern-table thead th.th-date-added {
    min-width: 140px;
}

.modern-table thead th.th-actions {
    min-width: 180px;
}

/* ===== STUDENT MANAGEMENT TABLE CELLS ===== */
.modern-table tbody td.text-center {
    text-align: center;
}

.badge-compact {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
}

/* ===== MODERN BADGES ===== */
.modern-badge {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.2) 0%, rgba(108, 117, 125, 0.1) 100%);
    color: #495057;
    border: 1px solid rgba(108, 117, 125, 0.3);
    font-weight: 500;
}

/* ===== MODERN BUTTONS ===== */
.modern-btn-outline {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #667eea;
    font-weight: 500;
    transition: all 0.3s ease;
}

.modern-btn-outline:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.modern-btn-outline.btn-lg {
    border-width: 2px;
}

/* ===== EMPTY STATES ===== */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
}

.empty-state-icon {
    font-size: 3rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

.empty-state-text {
    color: #6c757d;
    font-size: 0.95rem;
}

/* ===== LIST ITEMS ===== */
.modern-list-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef !important;
    transition: background-color 0.2s ease;
}

.modern-list-item:hover {
    background-color: rgba(102, 126, 234, 0.03) !important;
}

.modern-list-item-title {
    font-size: 0.95rem;
    color: #2d3748;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.modern-list-item-text {
    font-size: 0.85rem;
    color: #6c757d;
}

.modern-list-item-small {
    font-size: 0.8rem;
    color: #6c757d;
}

.parent-deadlines-list .parent-deadline-row {
    padding-top: 0.35rem !important;
    padding-bottom: 0.35rem !important;
}
.parent-deadlines-list .parent-deadline-meta {
    margin-bottom: 0.15rem;
}
.parent-deadlines-list .parent-deadline-title {
    margin-bottom: 0.2rem !important;
}
.parent-deadlines-list .parent-deadline-days {
    margin-top: 0.15rem !important;
}

/* ===== TEXT COLORS ===== */
.text-dark-modern {
    color: #2d3748 !important;
}

.text-muted-modern {
    color: #6c757d !important;
}

.text-link-modern {
    color: #667eea;
    text-decoration: none;
    transition: all 0.3s ease;
}

.text-link-modern:hover {
    color: #764ba2;
    text-decoration: underline;
}

.contact-link:hover {
    text-decoration: underline !important;
}

/* ===== SPACING ===== */
.modern-card-body {
    padding: 0.75rem;
}

.modern-card-body-compact {
    padding: 0.5rem 0.75rem;
}

.modern-card-with-header {
    min-height: 200px;
}

.modern-card-with-header.collapsible-card {
    min-height: auto;
}

.collapse-header {
    cursor: pointer;
    user-select: none;
}

.collapse-header:hover {
    background-color: #f8f9fa;
}

.collapse-icon {
    transition: transform 0.3s ease;
}

.collapse-header[aria-expanded="true"] .collapse-icon {
    transform: rotate(180deg);
}

.collapsible-card .collapse:not(.show) {
    display: none;
}

.test-status-icon-active {
    color: #43e97b;
}

.test-status-icon-inactive {
    color: #6c757d;
}

.table-col-width-40 {
    width: 40%;
}

.table-col-width-10 {
    width: 10%;
}

.table-col-min-width-40 {
    min-width: 40px;
}

.table-col-min-width-50 {
    min-width: 50px;
}

.table-col-min-width-55 {
    min-width: 55px;
}

.table-col-min-width-60 {
    min-width: 60px;
}

.table-col-min-width-70 {
    min-width: 70px;
}

.table-col-min-width-80 {
    min-width: 80px;
}

.table-col-min-width-120 {
    min-width: 120px;
}

.stat-cards-row {
    flex-wrap: nowrap;
}

@media (max-width: 768px) {
    .stat-card .card-body {
        padding-left: 0.1rem !important;
        padding-right: 0.1rem !important;
    }
    .test-details-status-badge {
        padding: 0.35em 0.5em;
    }
    .test-details-status-badge .fas {
        margin: 0;
    }
    .assignment-details-status-badge {
        padding: 0.35em 0.5em;
    }
    .assignment-details-status-badge .fas {
        margin: 0;
    }
    .assignment-details-th-icon {
        min-width: 2rem !important;
        width: 2.5rem;
        padding-left: 0.35rem !important;
        padding-right: 0.35rem !important;
    }
    .assignment-details-th-icon .fas {
        margin: 0;
    }
    .assignment-details-actions-cell {
        white-space: nowrap !important;
        min-width: 100px !important;
    }
    .assignment-details-actions-cell .d-flex {
        flex-wrap: nowrap !important;
    }
    .assignment-details-actions-cell .btn {
        flex-shrink: 0;
    }
}

.assignment-details-test-name-cell {
    hyphens: none;
    -webkit-hyphens: none;
    -moz-hyphens: none;
    -ms-hyphens: none;
    word-break: normal;
    overflow-wrap: break-word;
}

/* ===== NAVBAR MODERN STYLE ===== */
.navbar-modern {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.98) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.navbar-brand-modern {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem;
}

.navbar-logo {
    height: 40px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.navbar-logo .logo-bg {
    fill: transparent;
}

.nav-link-modern {
    color: #2d3748;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 0.5rem 0.75rem !important;
}

.nav-link-modern:hover {
    background-color: rgba(102, 126, 234, 0.05);
    transform: translateY(-1px);
}

.nav-link-icon {
    color: #667eea;
}

.navbar-modern .nav-link.nav-link-modern .nav-link-icon,
.navbar-modern .navbar-collapse .navbar-nav .nav-link-modern > i.fa,
.navbar-modern.navbar-role-admin .navbar-collapse .admin-db-dropdown-toggle .nav-link-icon,
.navbar-modern .nav-link.nav-link-modern .gradient-icon-purple {
    margin-inline-end: 0.25rem;
}

.navbar-modern .nav-link-modern .gradient-icon-purple,
.navbar-modern .nav-link-modern > i.gradient-icon-purple {
    font-size: 1.2rem;
}

.navbar-profile-avatar-ring {
    width: 32px;
    height: 32px;
    padding: 2px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 1px 4px rgba(102, 126, 234, 0.35);
}

.navbar-profile-avatar {
    width: 28px;
    height: 28px;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.95);
}

/* Бургер (<sm): колонка с профилем не центрируется по экрану — см. .container-fluid > div .nav-link { justify-content: center } */
@media (max-width: 575.98px) {
    .navbar-modern .navbar-collapse > ul.navbar-nav:last-child {
        align-items: flex-start;
        width: 100%;
    }

    .navbar-modern .navbar-collapse .navbar-profile-toggle {
        justify-content: flex-start !important;
        width: 100%;
    }
}

.dropdown-menu-modern {
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
}

.dropdown-item-modern {
    border-radius: 8px;
    margin: 0.2rem 0;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
}

.dropdown-item-modern:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transform: translateX(3px);
}

.dropdown-item-icon {
    color: #667eea;
}

.dropdown-item-icon-pink {
    color: #f5576c;
}

.dropdown-item-icon-blue {
    color: #4facfe;
}

.dropdown-item-icon-blue-alt {
    color: #2196F3;
}

.dropdown-item-icon-green {
    color: #43e97b;
}

.dropdown-item-icon-yellow {
    color: #fa709a;
}

.dropdown-item-icon-gold {
    color: #FFD700;
}

.dropdown-item-icon-teal {
    color: #30cfd0;
}

.dropdown-item-icon-orange {
    color: #ea580c;
}

.dropdown-item-icon-violet {
    color: #8b5cf6;
}

.dropdown-item-icon-cyan {
    color: #06b6d4;
}

.dropdown-item-icon-amber {
    color: #f59e0b;
}

.dropdown-item-icon-sky {
    color: #0ea5e9;
}

.dropdown-item-icon-coral {
    color: #f43f5e;
}

.dropdown-item-icon-lime {
    color: #84cc16;
}

.dropdown-divider-modern {
    margin: 0.5rem 0;
}

.dropdown-menu.teacher-menu-root,
.dropdown-menu.admin-menu-root {
    min-width: 11.5rem;
}

.teacher-menu-root .dropend .dropdown-menu,
.admin-menu-root .dropend .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: 0;
    margin-left: 0.25rem;
    min-width: 11.5rem;
}

.teacher-menu-root .dropend .dropdown-menu .dropdown-item i.fas,
.teacher-menu-root .dropend .dropdown-menu .dropdown-item i.far,
.teacher-menu-root .dropend .dropdown-menu .dropdown-item i.fab,
.admin-menu-root .dropend .dropdown-menu .dropdown-item i.fas,
.admin-menu-root .dropend .dropdown-menu .dropdown-item i.far,
.admin-menu-root .dropend .dropdown-menu .dropdown-item i.fab {
    margin-inline-end: 0.2rem;
}

.teacher-menu-root .dropend > .dropdown-item.dropdown-toggle,
.teacher-menu-root .dropend .dropend > .dropdown-item.dropdown-toggle,
.admin-menu-root .dropend > .dropdown-item.dropdown-toggle,
.admin-menu-root .dropend .dropend > .dropdown-item.dropdown-toggle {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.teacher-menu-root .dropend > .dropdown-item.dropdown-toggle::after,
.teacher-menu-root .dropend .dropend > .dropdown-item.dropdown-toggle::after,
.admin-menu-root .dropend > .dropdown-item.dropdown-toggle::after,
.admin-menu-root .dropend .dropend > .dropdown-item.dropdown-toggle::after {
    margin-left: auto;
    content: "\f054";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    border: none;
    vertical-align: middle;
    flex-shrink: 0;
}

.navbar-toggler-modern {
    border: none;
    padding: 0;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.08) 100%);
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.navbar-toggler-modern:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.12) 100%);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.25);
}

.navbar-toggler-modern:active {
    transform: scale(0.96);
}

.navbar-toggler-modern:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

/* Справка в шапке — минимальный зазор до колокольчика */
.navbar-header-faq {
    margin-right: 0.125rem;
}

.navbar-modern .container-fluid > .navbar-header-faq .nav-link {
    padding-right: 0.35rem !important;
}

.navbar-modern .navbar-nav > li.navbar-header-faq {
    margin-right: 0.125rem;
}

.navbar-modern .container-fluid > div .nav-link.nav-link-modern {
    min-width: 2.5rem;
    min-height: 2.5rem;
    padding: 0.5rem 0.65rem !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.navbar-modern .container-fluid > div .nav-link.nav-link-modern .nav-link-icon {
    font-size: 1.2rem;
}
.navbar-modern .container-fluid .admin-header-db-mobile .admin-db-dropdown-toggle .nav-link-icon {
    font-size: 1.2rem;
}
.navbar-modern .navbar-collapse .navbar-nav .nav-link.nav-link-modern .nav-link-icon,
.navbar-modern .navbar-collapse .navbar-nav .nav-link.nav-link-modern > i.fa,
.navbar-modern.navbar-role-admin .navbar-collapse .admin-db-dropdown-toggle .nav-link-icon {
    font-size: 1.2rem;
}
.navbar-modern .navbar-collapse .navbar-nav .nav-link.nav-link-modern {
    min-height: 2.5rem;
    padding: 0.5rem 0.75rem !important;
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .navbar-role-teacher .nav-link-text,
    .navbar-role-student .nav-link-text,
    .navbar-role-admin .nav-link-text {
        display: none;
    }
    .navbar-role-teacher .nav-link.dropdown-toggle::after,
    .navbar-role-student .nav-link.dropdown-toggle::after,
    .navbar-role-admin .nav-link.dropdown-toggle::after {
        display: none;
    }
}

.hamburger-modern-box {
    position: relative;
    width: 22px;
    height: 20px;
}

.hamburger-modern-line {
    position: absolute;
    left: 0;
    width: 22px;
    height: 2px;
    border-radius: 1px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform-origin: center center;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.2s ease;
}

.hamburger-modern-line:nth-child(1) {
    top: 0;
}

.hamburger-modern-line:nth-child(2) {
    top: 50%;
    margin-top: -1px;
}

.hamburger-modern-line:nth-child(3) {
    top: 100%;
    margin-top: -2px;
}

.hamburger-modern[aria-expanded="true"] .hamburger-modern-line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger-modern[aria-expanded="true"] .hamburger-modern-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger-modern[aria-expanded="true"] .hamburger-modern-line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Мобильный вид: бургер на 20% компактнее */
@media (max-width: 575.98px) {
    .navbar-toggler-modern {
        width: 35.2px;
        height: 35.2px;
        border-radius: 9.6px;
    }

    .hamburger-modern-box {
        width: 17.6px;
        height: 16px;
    }

    .hamburger-modern-line {
        width: 17.6px;
        height: 1.6px;
        border-radius: 0.8px;
    }

    .hamburger-modern-line:nth-child(2) {
        margin-top: -0.8px;
    }

    .hamburger-modern-line:nth-child(3) {
        margin-top: -1.6px;
    }

    .hamburger-modern[aria-expanded="true"] .hamburger-modern-line:nth-child(1) {
        transform: translateY(7.2px) rotate(45deg);
    }

    .hamburger-modern[aria-expanded="true"] .hamburger-modern-line:nth-child(3) {
        transform: translateY(-7.2px) rotate(-45deg);
    }
}

/* ===== FOOTER MODERN STYLE ===== */
.footer-modern {
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
    border-top: 1px solid rgba(102, 126, 234, 0.1);
}

.footer-column-title {
    color: #2d3748;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 2px;
    line-height: 1.2;
}

.footer-column-text {
    color: #6c757d;
    font-size: 0.75rem;
    margin-bottom: 2px;
    line-height: 1.25;
}

@media (max-width: 575.98px) {
    .footer-column-title {
        font-size: 0.68rem;
        hyphens: none;
        -webkit-hyphens: none;
        word-break: normal;
        overflow-wrap: break-word;
    }

    .footer-column-text {
        font-size: 0.62rem;
        line-height: 1.2;
        word-break: normal;
        overflow-wrap: break-word;
        hyphens: none;
        -webkit-hyphens: none;
    }

    .footer-copy {
        font-size: 0.62rem;
        hyphens: none;
        -webkit-hyphens: none;
        word-break: normal;
        overflow-wrap: break-word;
    }

    .footer-documents-toggle {
        font-size: 0.68rem;
        hyphens: none;
        -webkit-hyphens: none;
        word-break: normal;
        overflow-wrap: break-word;
    }

    .footer-modern .footer-column,
    .footer-modern .footer-column a,
    .footer-modern .footer-column-link {
        hyphens: none;
        -webkit-hyphens: none;
        word-break: normal;
        overflow-wrap: break-word;
    }

    .footer-modern .social-links a,
    .footer-modern .footer-social-link {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
}

.footer-column-link {
    color: #6c757d;
    text-decoration: none;
    transition: all 0.2s ease;
}

.footer-column-link:hover {
    color: #667eea;
    transform: translateY(-1px);
}

.footer-links-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 0;
}

.footer-links-row {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0.75rem;
}

.footer-links-compact .footer-column-link {
    font-size: 0.75rem;
    white-space: nowrap;
}

.footer-copy {
    color: #6c757d;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
}

.footer-documents-toggle {
    color: #6c757d;
    font-size: 0.75rem;
    text-decoration: none;
    padding: 0;
    line-height: 1.2;
    border: 0;
    box-shadow: none;
}

.footer-documents-toggle:hover,
.footer-documents-toggle:focus,
.footer-documents-toggle:active,
.footer-documents-toggle.show {
    color: #667eea;
    text-decoration: none;
    box-shadow: none;
}

.footer-documents-toggle::after {
    margin-left: 0.3em;
    vertical-align: 0.12em;
}

.footer-documents-menu {
    --bs-dropdown-min-width: 15rem;
    font-size: 0.8125rem;
    z-index: 1080;
}

.footer-documents-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.85rem;
    color: #4a5568;
}

.footer-documents-menu .dropdown-item i {
    width: 1rem;
    text-align: center;
    opacity: 0.85;
}

.footer-documents-menu .dropdown-item:hover,
.footer-documents-menu .dropdown-item:focus {
    color: #667eea;
    background-color: rgba(102, 126, 234, 0.08);
}

.footer-documents-menu .dropdown-divider {
    margin: 0.25rem 0;
}

.footer-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.footer-social-link:hover {
    transform: translateY(-2px) scale(1.08);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.25);
}

.footer-social-link-email {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 1px solid rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.footer-social-link-tech-email {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.1) 0%, rgba(0, 242, 254, 0.1) 100%);
    border: 1px solid rgba(79, 172, 254, 0.2);
    color: #4facfe;
}

.footer-social-link-telegram {
    background: linear-gradient(135deg, rgba(0, 136, 204, 0.1) 0%, rgba(0, 136, 204, 0.05) 100%);
    border: 1px solid rgba(0, 136, 204, 0.2);
    color: #0088cc;
}

.footer-social-link-telegram:hover {
    background: linear-gradient(135deg, #0088cc 0%, #0066aa 100%) !important;
    color: white !important;
}

.footer-mobile-title-modern {
    color: #2d3748;
    font-weight: bold;
    margin-bottom: 1px;
}

.footer-mobile-name-modern {
    color: #6c757d;
    margin-bottom: 2px;
}

.footer-mobile-bottom {
    margin-top: 4px;
}

.footer-mobile-links-compact {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.footer-mobile-sep {
    color: #adb5bd;
    font-size: 0.7rem;
    line-height: 1;
}

/* ===== PAGE HEADERS ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.page-header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
    color: #2d3748;
    font-weight: bold;
}

.page-header-icon {
    color: #667eea;
}

.page-header > .d-flex {
    flex-shrink: 0;
    align-items: center;
}
.page-header .btn {
    min-height: 2.25rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ===== MODERN BUTTONS EXTENDED ===== */
.btn-modern-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 0;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-modern-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white;
}

.btn-modern-success {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    border: 0;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-modern-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 233, 123, 0.4);
    color: white;
}

.btn-modern-success-calm {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border: 0;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-modern-success-calm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
    color: white;
}

.btn-modern-warning-calm {
    background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
    border: 0;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-modern-warning-calm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.3);
    color: white;
}

.btn-modern-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    border: 0;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-modern-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
    color: white;
}

.btn-modern-danger {
    background: linear-gradient(135deg, #c75050 0%, #a94442 100%);
    border: 0;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-modern-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(169, 68, 66, 0.4);
    color: white;
}

.btn-modern-danger-calm {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: 0;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-modern-danger-calm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.28);
    color: white;
}

.btn-demo-teacher {
    background: linear-gradient(135deg, #388e3c 0%, #1b5e20 100%);
    border: 0;
    color: white !important;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(27, 94, 32, 0.2);
}

.btn-demo-teacher:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(27, 94, 32, 0.3);
    filter: brightness(1.1);
}

.btn-demo-student {
    background: linear-gradient(135deg, #48C6EF 0%, #6F86D6 100%);
    border: 0;
    color: white !important;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(111, 134, 214, 0.3);
}

.btn-demo-student:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(111, 134, 214, 0.4);
    filter: brightness(1.05);
}

/* ===== EMPTY STATE EXTENDED ===== */
.empty-state-large {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state-large-icon {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1.5rem;
}

.empty-state-large-title {
    color: #6c757d;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state-large-text {
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* ===== SEARCH AND FILTER ===== */
.search-filter-card {
    border-radius: 12px;
    border: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.search-filter-card .card-body {
    padding: 0.75rem 1rem;
}

.search-filter-card .btn.btn-sm.btn-resp-icon-text {
    min-height: calc(1.5em + 0.5rem + 2px);
}

@media (max-width: 991.98px) {
    .period-filter-card.search-filter-card {
        margin-bottom: 0.75rem !important;
    }

    .period-filter-card .card-body {
        padding: 0.45rem 0.65rem !important;
    }

    .period-filter-card .form-label {
        margin-bottom: 0.15rem !important;
        font-size: clamp(0.7rem, 0.64rem + 0.2vw, 0.78rem);
        line-height: 1.15;
    }

    .period-filter-card .form-select-sm {
        min-height: 1.9rem;
        padding-top: 0.2rem;
        padding-bottom: 0.2rem;
        font-size: clamp(0.75rem, 0.7rem + 0.2vw, 0.85rem);
    }

    .period-filter-card .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* ===== ACCORDION MODERN ===== */
.accordion-modern .accordion-item {
    border-radius: 12px;
    border: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.accordion-modern .accordion-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.accordion-modern .accordion-button {
    border-radius: 12px;
    background: white;
    border: 0;
    font-weight: 500;
    color: #2d3748;
    padding: 0.75rem 1rem;
}

.accordion-modern .accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    color: #667eea;
    box-shadow: none;
}

.accordion-modern .accordion-body {
    padding: 1rem;
    background: white;
    border-radius: 0 0 12px 12px;
}

/* ===== LOGIN/REGISTER CARDS ===== */
.auth-card {
    border-radius: 12px;
    border: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.auth-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    padding: 1.25rem;
    text-align: center;
    border: 0;
}

.auth-card-header h4 {
    margin: 0;
    font-weight: 600;
}

.auth-logo {
    display: flex;
    justify-content: center;
}
.auth-logo .navbar-logo {
    height: 56px;
    width: auto;
}

.auth-card-body {
    padding: 1.5rem;
}

.auth-card-footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 12px 12px;
    padding: 1rem;
    text-align: center;
}

/* ===== FORM ELEMENTS ===== */
.form-label-modern {
    color: #2d3748;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-control-modern {
    border-radius: 8px;
    border: 1px solid #e9ecef;
    padding: 0.5rem 0.75rem;
    transition: all 0.3s ease;
}

.form-control-modern:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

/* ===== BADGE VARIANTS ===== */
.badge-modern-info {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.2) 0%, rgba(0, 242, 254, 0.2) 100%);
    color: #4facfe;
    border: 1px solid rgba(79, 172, 254, 0.3);
    font-weight: 500;
}

.badge-modern-primary {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.3);
    font-weight: 500;
}

.badge-modern-success {
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.2) 0%, rgba(56, 249, 215, 0.2) 100%);
    color: #43e97b;
    border: 1px solid rgba(67, 233, 123, 0.3);
    font-weight: 500;
}

.badge-modern-secondary {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.2) 0%, rgba(108, 117, 125, 0.1) 100%);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.3);
    font-weight: 500;
}

.badge-modern-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 152, 0, 0.2) 100%);
    color: #ff9800;
    border: 1px solid rgba(255, 193, 7, 0.3);
    font-weight: 500;
}

.badge-modern-success-calm {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(22, 163, 74, 0.15) 100%);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.25);
    font-weight: 500;
}

.badge-modern-warning-calm {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.15) 0%, rgba(202, 138, 4, 0.15) 100%);
    color: #ca8a04;
    border: 1px solid rgba(234, 179, 8, 0.25);
    font-weight: 500;
}

.badge-modern-danger {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.2) 0%, rgba(211, 47, 47, 0.2) 100%);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
    font-weight: 500;
}

/* ===== MODERN OUTLINE BUTTONS WITH BLACK ICONS ===== */
.btn-modern-outline-primary,
.btn-modern-outline-info,
.btn-modern-outline-success,
.btn-modern-outline-warning,
.btn-modern-outline-danger,
.btn-modern-outline-secondary {
    background: transparent;
    border: 1px solid #e9ecef;
    color: #2d3748;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.375rem 0.75rem;
}

.btn-modern-outline-primary:hover,
.btn-modern-outline-info:hover,
.btn-modern-outline-success:hover,
.btn-modern-outline-warning:hover,
.btn-modern-outline-danger:hover,
.btn-modern-outline-secondary:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #2d3748;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-modern-outline-primary i,
.btn-modern-outline-info i,
.btn-modern-outline-success i,
.btn-modern-outline-warning i,
.btn-modern-outline-danger i,
.btn-modern-outline-secondary i {
    color: #2d3748;
}

.btn-modern-outline-primary:hover i,
.btn-modern-outline-info:hover i,
.btn-modern-outline-success:hover i,
.btn-modern-outline-warning:hover i,
.btn-modern-outline-danger:hover i,
.btn-modern-outline-secondary:hover i {
    color: #2d3748;
}

.btn-sm.btn-modern-outline-primary,
.btn-sm.btn-modern-outline-info,
.btn-sm.btn-modern-outline-success,
.btn-sm.btn-modern-outline-warning,
.btn-sm.btn-modern-outline-danger,
.btn-sm.btn-modern-outline-secondary {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-modern-outline-danger {
    border-color: #b85450;
    color: #b85450;
}
.btn-modern-outline-danger:hover {
    border-color: #a94442;
    background: rgba(184, 84, 80, 0.08);
    color: #a94442;
}
.btn-modern-outline-danger i,
.btn-modern-outline-danger:hover i {
    color: inherit;
}

.btn-modern-outline-warning-calm {
    background: transparent;
    border: 1px solid #ca8a04;
    color: #b45300;
    font-weight: 500;
    transition: all 0.3s ease;
}
.btn-modern-outline-warning-calm:hover {
    background: rgba(234, 179, 8, 0.1);
    border-color: #eab308;
    color: #ca8a04;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(234, 179, 8, 0.15);
}
.btn-modern-outline-warning-calm i,
.btn-modern-outline-warning-calm:hover i {
    color: inherit;
}
.btn-sm.btn-modern-outline-warning-calm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-danger {
    background: #b85450;
    border-color: #a94442;
    color: #fff;
}
.btn-danger:hover {
    background: #a94442;
    border-color: #993d3b;
    color: #fff;
}

.dropdown-item.text-danger,
.dropdown-item.text-danger i {
    color: #b85450 !important;
}
.dropdown-item.text-danger:hover {
    background: rgba(184, 84, 80, 0.1);
    color: #a94442;
}

/* ===== MODERN ALERTS ===== */
.modern-alert-info {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.1) 0%, rgba(0, 242, 254, 0.1) 100%);
    border-left: 4px solid #4facfe;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #2d3748;
}

@media (max-width: 768px) {
    .table-responsive {
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: auto !important;
        width: 100%;
        max-width: 100%;
    }
    
    .table-responsive table {
        width: 100% !important;
        table-layout: auto;
        margin: 0;
    }
    
    .table-responsive table th,
    .table-responsive table td {
        min-width: 0 !important;
        max-width: none !important;
    }
    
    .table-responsive table td {
        word-break: break-word;
        overflow-wrap: break-word;
        white-space: normal !important;
        hyphens: none;
        -webkit-hyphens: none;
    }
    
    .table-responsive table th {
        white-space: normal !important;
        word-break: keep-all;
        overflow-wrap: break-word;
        font-size: 0.75rem;
        padding: 0.5rem 0.25rem !important;
        line-height: 1.2;
    }
    .table-responsive #teacherClassRankingTable thead th:first-child,
    .table-responsive #teacherClassRankingTable tbody td:first-child,
    .table-responsive #classRankingTable thead th:first-child,
    .table-responsive #classRankingTable tbody td:first-child {
        padding-left: 0.1rem !important;
        padding-right: 0.1rem !important;
    }
    .table-responsive #teacherClassRankingTable th.ranking-table-position-col,
    .table-responsive #classRankingTable th.ranking-table-position-col {
        min-width: 4rem;
        width: auto;
    }
    .table-responsive #teacherClassRankingTable td.ranking-table-position-col,
    .table-responsive #classRankingTable td.ranking-table-position-col {
        white-space: nowrap !important;
    }
    .table-responsive #teacherClassRankingTable td.ranking-table-position-col .ranking-table-place-cell,
    .table-responsive #classRankingTable td.ranking-table-position-col .ranking-table-place-cell {
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
    }
    .table-responsive #teacherClassRankingTable td.ranking-table-position-col .ranking-table-place-cell span,
    .table-responsive #classRankingTable td.ranking-table-position-col .ranking-table-place-cell span {
        white-space: nowrap !important;
    }
    .table-responsive #teacherClassRankingTable th.ranking-table-rating-col,
    .table-responsive #classRankingTable th.ranking-table-rating-col {
        min-width: 7em !important;
        white-space: nowrap !important;
        word-break: normal !important;
    }
    .table-responsive table td {
        padding: 0.5rem 0.25rem !important;
        font-size: 0.8rem;
        line-height: 1.3;
    }
    
    .table-responsive .btn-sm {
        padding: 0.2rem 0.35rem;
        font-size: 0.7rem;
        line-height: 1.2;
    }
    
    .table-responsive .badge {
        font-size: 0.65rem;
        padding: 0.1rem 0.25rem;
        white-space: normal;
        word-break: break-word;
        display: inline-block;
        max-width: 100%;
    }
    
    .table-responsive .ranking-table-badge-numeric {
        white-space: nowrap !important;
        word-break: keep-all !important;
        display: inline-block !important;
    }
    
    .table-responsive .d-flex {
        flex-wrap: wrap;
    }
    
    .table-responsive .ranking-table-points-container {
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
    }
    
    .table-responsive .fas {
        flex-shrink: 0;
    }

    .teacher-recent-results-table-wrap {
        overflow-x: hidden !important;
    }
    .teacher-recent-results-table .teacher-rr-col-test,
    .teacher-recent-results-table .test-title-text {
        word-break: normal;
        overflow-wrap: break-word;
        hyphens: none;
    }
    .teacher-recent-results-table .teacher-rr-col-grade,
    .teacher-recent-results-table .teacher-rr-col-actions {
        white-space: nowrap !important;
        word-break: normal;
    }

    .table-responsive:has(.table-achievements) {
        overflow-x: auto !important;
    }
    .table-responsive .table-achievements thead th {
        white-space: nowrap !important;
        word-break: normal;
    }
    .table-responsive .table-achievements .col-award-name {
        min-width: 12rem;
        word-break: normal;
        overflow-wrap: break-word;
        hyphens: none;
    }
}

@media (max-width: 575.98px) {
    .table-responsive table th {
        font-size: 0.7rem;
        padding: 0.4rem 0.2rem !important;
    }
    .table-responsive #teacherClassRankingTable thead th:first-child,
    .table-responsive #teacherClassRankingTable tbody td:first-child,
    .table-responsive #classRankingTable thead th:first-child,
    .table-responsive #classRankingTable tbody td:first-child {
        padding-left: 0.1rem !important;
        padding-right: 0.1rem !important;
    }
    .table-responsive #teacherClassRankingTable th.ranking-table-position-col,
    .table-responsive #classRankingTable th.ranking-table-position-col {
        min-width: 4rem;
        width: auto;
    }
    .table-responsive #teacherClassRankingTable td.ranking-table-position-col,
    .table-responsive #classRankingTable td.ranking-table-position-col {
        white-space: nowrap !important;
    }
    .table-responsive #teacherClassRankingTable td.ranking-table-position-col .ranking-table-place-cell,
    .table-responsive #classRankingTable td.ranking-table-position-col .ranking-table-place-cell {
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
    }
    .table-responsive #teacherClassRankingTable td.ranking-table-position-col .ranking-table-place-cell span,
    .table-responsive #classRankingTable td.ranking-table-position-col .ranking-table-place-cell span {
        white-space: nowrap !important;
    }
    .table-responsive #teacherClassRankingTable th.ranking-table-rating-col,
    .table-responsive #classRankingTable th.ranking-table-rating-col {
        min-width: 7em !important;
        white-space: nowrap !important;
        word-break: normal !important;
    }
    .table-responsive table td {
        font-size: 0.75rem;
        padding: 0.4rem 0.2rem !important;
    }
    
    .table-responsive .btn-sm {
        padding: 0.15rem 0.3rem;
        font-size: 0.65rem;
    }
    
    .table-responsive .btn-sm .fas {
        font-size: 0.7rem;
    }
    
    .table-responsive .ranking-table-points-container {
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        display: inline-flex !important;
    }
}

/* ===== MEDAL STYLES ===== */
.medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1rem;
    color: white;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.medal::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50% 50% 0 0;
    background: inherit;
}

.medal-gold {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-color: rgba(255, 215, 0, 0.5);
}

.medal-silver {
    background: linear-gradient(135deg, #C0C0C0 0%, #A8A8A8 100%);
    border-color: rgba(192, 192, 192, 0.5);
}

.medal-bronze {
    background: linear-gradient(135deg, #CD7F32 0%, #B87333 100%);
    border-color: rgba(205, 127, 50, 0.5);
}

.medal-small {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 0.85rem;
}

.medal-small::before {
    width: 0.4rem;
    height: 0.4rem;
}

/* ===== RANKING TABLE STYLES ===== */

.th-with-tooltip {
    cursor: pointer;
}

.ranking-table-position-col {
    width: 80px;
}

#teacherClassRankingTable td.ranking-table-position-col,
#classRankingTable td.ranking-table-position-col {
    white-space: nowrap;
}

#teacherClassRankingTable .ranking-table-place-cell,
#classRankingTable .ranking-table-place-cell {
    flex-wrap: nowrap;
    white-space: nowrap;
}

.ranking-table-rating-col {
    min-width: 8em;
}

.table-responsive #teacherClassRankingTable thead th:first-child,
.table-responsive #teacherClassRankingTable tbody td:first-child,
.table-responsive #classRankingTable thead th:first-child,
.table-responsive #classRankingTable tbody td:first-child {
    padding-left: 0.35rem !important;
}

.ranking-table-badge-small {
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
}

.ranking-table-student-cell {
    word-break: normal;
    hyphens: none;
    -webkit-hyphens: none;
    -moz-hyphens: none;
    -ms-hyphens: none;
}

.ranking-table-numeric-cell {
    white-space: nowrap;
}

.ranking-table-badge-numeric {
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    white-space: nowrap !important;
    word-break: keep-all !important;
    display: inline-block !important;
}

.ranking-table-points-container {
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
    display: inline-flex !important;
    min-width: 0;
}

.ranking-table-points-icon {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

.ranking-table-points-value {
    font-size: 1.1rem;
    white-space: nowrap !important;
    word-break: keep-all !important;
    flex-shrink: 0 !important;
}

.ranking-formula-text {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

.ranking-info-list {
    line-height: 1.8;
}

.ranking-info-sublist {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

/* ===== RANKING TABLE MOBILE STYLES ===== */
@media (max-width: 768px) {
    .ranking-table-badge-numeric {
        font-size: 0.95rem !important;
        padding: 0.45rem 0.65rem !important;
        font-weight: 600;
        white-space: nowrap !important;
        word-break: keep-all !important;
        display: inline-block !important;
    }
    
    .ranking-table-points-value {
        font-size: 1rem !important;
    }
    
    .ranking-table-points-icon {
        font-size: 0.95rem !important;
    }
    
    .ranking-table-badge-small {
        font-size: 0.85rem !important;
        padding: 0.35rem 0.55rem !important;
    }
}

@media (max-width: 575.98px) {
    .ranking-table-badge-numeric {
        font-size: 1rem !important;
        padding: 0.5rem 0.7rem !important;
        font-weight: 600;
        white-space: nowrap !important;
        word-break: keep-all !important;
        display: inline-block !important;
    }
    
    .ranking-table-points-value {
        font-size: 1.05rem !important;
    }
    
    .ranking-table-points-icon {
        font-size: 1rem !important;
    }
    
    .ranking-table-badge-small {
        font-size: 0.9rem !important;
        padding: 0.4rem 0.6rem !important;
    }
    
    .ranking-table-numeric-cell {
        font-size: 0.85rem !important;
    }
    
    .ranking-table-points-icon,
    .ranking-table-points-value {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }
}

.teacher-recent-results-table-wrap {
    --trr-font: clamp(0.68rem, 0.5rem + 0.42vw, 0.875rem);
    --trr-pad-inline: clamp(0.2rem, 0.05rem + 0.45vw, 0.75rem);
    --trr-pad-block: clamp(0.3rem, 0.18rem + 0.28vw, 0.5rem);
    --trr-badge-font: clamp(0.6rem, 0.45rem + 0.32vw, 0.875rem);
    --trr-badge-pad-x: clamp(0.12rem, 0.04rem + 0.28vw, 0.5rem);
    --trr-badge-pad-y: clamp(0.08rem, 0.04rem + 0.14vw, 0.25rem);
    --trr-cell-gap: clamp(0.2rem, 0.08rem + 0.35vw, 0.5rem);
    --trr-icon: clamp(0.8rem, 0.65rem + 0.35vw, 1.05rem);
    --trr-grade-w: clamp(2.6rem, 1.8rem + 2.8vw, 4.25rem);
    --trr-actions-w: clamp(2.1rem, 1.6rem + 1.6vw, 5rem);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.teacher-recent-results-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    font-size: var(--trr-font);
}

.teacher-recent-results-table th,
.teacher-recent-results-table td {
    min-width: 0;
    padding: var(--trr-pad-block) var(--trr-pad-inline);
    vertical-align: middle;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.teacher-recent-results-table .teacher-rr-col-student {
    width: 34%;
}

.teacher-recent-results-table .teacher-rr-col-test {
    width: auto;
    text-align: center !important;
}

.teacher-recent-results-table .teacher-rr-col-grade {
    width: var(--trr-grade-w);
    white-space: nowrap;
}

.teacher-recent-results-table .teacher-rr-col-actions {
    width: var(--trr-actions-w);
    white-space: nowrap;
}

.teacher-recent-results-table .teacher-rr-col-class,
.teacher-recent-results-table .teacher-rr-col-subject {
    width: 8%;
}

.teacher-recent-results-table .teacher-rr-col-date {
    width: 6.5rem;
    white-space: nowrap;
}

.teacher-recent-results-table .teacher-rr-student-cell {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    min-width: 0;
}

.teacher-recent-results-table .teacher-rr-student-meta {
    min-width: 0;
    flex: 1;
}

.teacher-recent-results-table .teacher-rr-student-name {
    display: block;
    word-break: break-word;
}

.teacher-recent-results-table .teacher-rr-test-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--trr-cell-gap);
    min-width: 0;
    max-width: 100%;
    flex-wrap: nowrap;
    vertical-align: middle;
}

.teacher-recent-results-table .test-type-icon {
    color: #667eea;
    flex: 0 0 var(--trr-icon);
    width: var(--trr-icon);
    font-size: var(--trr-icon);
    line-height: 1.2;
    text-align: center;
    margin-top: 0;
}
.teacher-recent-results-table .test-title-wrap {
    min-width: 0;
    flex: 0 1 auto;
    max-width: 100%;
    text-align: center;
}
.teacher-recent-results-table .test-title-text {
    word-break: break-word;
    overflow-wrap: anywhere;
    text-align: center;
}

.teacher-recent-results-table .badge.modern-badge:not(.grade-badge),
.teacher-recent-results-table .badge.badge-compact {
    font-size: var(--trr-badge-font) !important;
    padding: var(--trr-badge-pad-y) var(--trr-badge-pad-x) !important;
}

.teacher-recent-results-table .grade-badge {
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: clamp(0.65rem, 0.5rem + 0.35vw, 0.875rem) !important;
    padding: clamp(0.12rem, 0.08rem + 0.12vw, 0.25rem) clamp(0.2rem, 0.1rem + 0.25vw, 0.5rem) !important;
    min-width: clamp(1.4rem, 1.1rem + 0.8vw, 1.75rem);
    min-height: clamp(1.4rem, 1.1rem + 0.8vw, 1.75rem);
    line-height: 1;
    box-sizing: border-box;
    max-width: 100%;
}

.teacher-recent-results-table .view-test-result {
    white-space: nowrap;
}

.teacher-recent-results-table .action-icon-btn {
    width: clamp(1.45rem, 1.2rem + 0.7vw, 1.75rem);
    height: clamp(1.45rem, 1.2rem + 0.7vw, 1.75rem);
    min-width: clamp(1.45rem, 1.2rem + 0.7vw, 1.75rem);
    flex-shrink: 0;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.7rem, 0.55rem + 0.3vw, 0.875rem);
}

.teacher-recent-results-table .action-icon-btn i {
    font-size: clamp(0.65rem, 0.5rem + 0.28vw, 0.75rem) !important;
}

@media (max-width: 991.98px) {
    .teacher-recent-results-table .teacher-rr-col-student {
        width: 30%;
    }
    .teacher-recent-results-table .teacher-rr-col-test {
        width: 42%;
    }
    .teacher-recent-results-table .teacher-rr-col-grade {
        width: 16%;
    }
    .teacher-recent-results-table .teacher-rr-col-actions {
        width: 12%;
    }
    .teacher-recent-results-table th.teacher-rr-col-grade,
    .teacher-recent-results-table th.teacher-rr-col-actions,
    .teacher-recent-results-table td.teacher-rr-col-grade,
    .teacher-recent-results-table td.teacher-rr-col-actions {
        overflow: hidden;
        text-overflow: clip;
    }
}

@media (max-width: 575.98px) {
    .teacher-recent-results-table .teacher-rr-col-student {
        width: 28%;
    }
    .teacher-recent-results-table .teacher-rr-col-test {
        width: 40%;
    }
    .teacher-recent-results-table .teacher-rr-col-grade {
        width: 18%;
    }
    .teacher-recent-results-table .teacher-rr-col-actions {
        width: 14%;
    }
}

@media (min-width: 992px) {
    .teacher-recent-results-table .teacher-rr-col-student {
        width: 18%;
    }
    .teacher-recent-results-table .teacher-rr-col-test {
        width: 26%;
    }
}

/* Переключатель месяца в журналах: ◀ месяц год ▶ */
.journal-month-nav {
    gap: 0.125rem;
}

.journal-month-nav-title {
    min-width: 0;
    margin: 0;
    padding: 0 0.1rem;
    text-align: center;
    line-height: 1.2;
}

/* Кнопки переключения месяца — единый вид (btn-outline-secondary btn-sm) */
.month-nav-btn,
.grade-month-nav-btn,
.trainer-month-nav-btn,
.testing-month-nav-btn,
.attendance-month-nav-btn,
.achievements-shelf-month-nav-btn,
.parent-ranking-nav-btn,
.teacher-completed-attempts-month-nav-btn,
.ruleofday-month-nav-btn {
    flex-shrink: 0;
}
