 /* ===== ОБЩИЕ СТИЛИ layout ===== */
        .layout {

            --right-work-height: 676px;
            --select-block-height: 112px;

            display: flex;

            gap: 20px;

            align-items: flex-start;
        }
        
        .left-column {

            width: 40%;

            min-width: 0;
        }

        .right-column {

            width: 60%;

            min-width: 0;

            display: flex;

            flex-direction: column;

        }
        
        /* ===== ОБЩИЕ СТИЛИ BODY ===== */
        
        html {

            scrollbar-gutter: stable;
        }

        body {

            /* Шрифт страницы */
            font-family: 'Inter', sans-serif;

            /* Максимальная ширина контента */
            max-width: 1600px;

            /* Центрирование */
            margin: 10px auto;

            /* Внутренние отступы */
            padding: 20px;

            /* Цвет фона */
            background: var(--teacher-gray-50);
        }

        /* ===== ГЛАВНЫЙ ЗАГОЛОВОК ===== */

        h1 {

            text-align: center;
        }

        .app-topbar {

            max-width: 1600px;

            margin: 0 auto 16px;

            display: flex;

            align-items: center;

            justify-content: space-between;

            gap: 18px;

            padding: 12px 16px;

            box-sizing: border-box;

            border: 1px solid var(--teacher-gray-200);

            border-radius: 14px;

            background: rgba(255, 255, 255, 0.94);

            box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
        }

        .app-brand {

            min-width: 0;

            display: flex;

            align-items: center;

            gap: 10px;
        }

        .app-brand-mark {

            width: 36px;

            height: 36px;

            display: block;

            flex: 0 0 auto;

            object-fit: contain;
        }

        .app-brand-text {

            min-width: 0;

            display: flex;

            flex-direction: column;

            gap: 1px;
        }

        .app-brand-text strong {

            color: var(--teacher-black);

            font-size: 15px;

            line-height: 18px;
        }

        .app-brand-text span {

            color: var(--teacher-gray-500);

            font-size: 13px;

            line-height: 16px;
        }

        .app-topbar-actions {

            min-width: 0;

            display: flex;

            align-items: center;

            justify-content: flex-end;

            gap: 10px;
        }

        .app-user-pill {

            max-width: min(520px, 48vw);

            overflow: hidden;

            text-overflow: ellipsis;

            white-space: nowrap;

            padding: 0;

            color: var(--teacher-orange-800);

            font-size: 13px;

            font-weight: 600;
        }

        .teacher-entry {

            max-width: 1600px;

            margin: -4px auto 14px;

            display: flex;

            justify-content: flex-end;
        }

        .teacher-entry a,
        .teacher-link,
        .teacher-secondary-button,
        .student-password-button {

            display: inline-flex;

            align-items: center;

            justify-content: center;

            min-height: 32px;

            padding: 6px 12px;

            box-sizing: border-box;

            border: 1px solid var(--teacher-gray-200);

            border-radius: 10px;

            background: white;

            color: var(--teacher-black);

            font: inherit;

            font-size: 13px;

            font-weight: 600;

            text-decoration: none;

            box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
        }

        .teacher-entry a:hover,
        .teacher-link:hover,
.teacher-secondary-button:hover {

            background: var(--teacher-gray-50);
        }

        .app-topbar .student-password-button:hover,
        .teacher-topbar-actions .teacher-secondary-button[data-teacher-password-action="true"]:hover {

            border-color: var(--teacher-orange-100);

            background: var(--teacher-orange-50);

            color: var(--teacher-orange-800);
        }

.teacher-admin-add-button {
    justify-self: start;
    min-height: 32px;
    min-width: auto;
    padding: 6px 12px;
    width: auto;
}

        .teacher-link {

            min-height: auto;

            padding: 0;

            border: 0;

            background: transparent;

            color: var(--teacher-gray-500);

            box-shadow: none;
        }

        .teacher-link:hover {

            color: var(--teacher-black);

            background: transparent;
        }

        .teacher-template-button {

            min-height: 32px;

            padding: 6px 9px;

            color: var(--teacher-gray-500);

            font-size: 13px;

            box-shadow: none;
        }

        .student-bar[hidden],
        .student-modal[hidden] {

            display: none;
        }

        #student_name {

            min-width: 0;

            overflow: hidden;

            text-overflow: ellipsis;

            white-space: nowrap;

            display: inline-flex;
        }

        .student-logout,
.teacher-logout-button {

            flex: 0 0 auto;

            display: inline-flex;

            align-items: center;

            justify-content: center;

            min-height: 32px;

            min-width: 112px;

            padding: 6px 12px;

            box-sizing: border-box;

            border: 1px solid var(--teacher-red-100);

            border-radius: 10px;

            background: var(--teacher-red-50);

            color: var(--teacher-red-800);

            font: inherit;

            font-size: 13px;

            font-weight: 600;

            box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);

            cursor: pointer;
        }

        .student-logout:hover,
        .teacher-logout-button:hover {

            background: var(--teacher-red-50);
        }

        .password-cancel-button {

            background: var(--teacher-gray-50);

            color: var(--teacher-gray-500);

            border: 1px solid var(--teacher-gray-200);
        }

        .password-cancel-button:hover {

            background: var(--teacher-gray-50);
        }

        .student-modal {

            position: fixed;

            inset: 0;

            z-index: 100;

            display: flex;

            align-items: flex-start;

            justify-content: center;

            padding: 56px 20px 20px;

            box-sizing: border-box;

            overflow-y: auto;

            background: rgba(245,245,245,0.88);

            backdrop-filter: blur(4px);
        }

        .student-card {

            position: relative;

            width: 420px;

            max-width: calc(100vw - 40px);

            height: 300px;

            display: grid;

            grid-template-rows: 28px 42px 42px 38px 34px 34px;

            gap: 14px;

            padding: 26px 24px;

            box-sizing: border-box;

            border: 1px solid var(--teacher-gray-200);

            border-radius: 16px;

            background: white;

            box-shadow: 0 18px 40px rgba(17,24,39,0.14);
        }

        .student-card h2 {

            margin: 0 0 4px;

            color: var(--teacher-black);

            font-size: 20px;

            line-height: 28px;
        }

        .student-card input,
        .student-card select {

            width: 100%;

            height: 42px;

            padding: 10px 12px;

            box-sizing: border-box;

            border: 1px solid var(--teacher-gray-200);

            border-radius: 10px;

            font: inherit;
        }

        .student-class-fields {

            display: grid;

            grid-template-columns: 1fr 1fr;

            gap: 10px;
        }

        .student-card input:focus,
        .student-card select:focus {

            border-color: var(--teacher-orange-500);

            outline: none;

            box-shadow: 0 0 0 3px rgba(233, 138, 58, 0.16);
        }

        .student-card button {

            height: 42px;

            border-radius: 10px;
        }

        .student-teacher-link {

            height: 38px;

            display: inline-flex;

            align-items: center;

            justify-content: center;

            color: var(--teacher-gray-500);

            font-size: 14px;

            text-decoration: none;

            border: 1px solid var(--teacher-gray-200);

            border-radius: 10px;

            background: var(--teacher-gray-50);
        }

        .student-card .student-teacher-link {

            margin-top: 2px;

            margin-bottom: 0;
        }

        .password-change-card {

            height: 372px;

            grid-template-rows: 28px 42px 42px 42px 38px 38px 34px;
        }

        .student-teacher-link:hover {

            background: var(--teacher-gray-50);
        }

        .login-demo-hint {

            position: absolute;

            top: calc(100% + 12px);

            left: 24px;

            right: 24px;

            margin: 0;

            display: flex;

            align-items: center;

            color: var(--teacher-gray-500);

            font-size: 13px;

            line-height: 17px;
        }

        .login-demo-hint + .login-demo-hint {

            top: calc(100% + 36px);
        }

        .student-error {

            min-height: 34px;

            color: var(--teacher-red-600);

            font-size: 14px;

            line-height: 17px;
        }

        /* ===== ОКНО ЧАТА ===== */

        .chat {

            background: white;

            border-radius: 16px;

            padding: 20px;

            border: 1px solid var(--teacher-gray-200);

            overflow-y: auto;

            margin-bottom: 8px;

            box-shadow: 0 2px 8px rgba(0,0,0,0.05);

            display: flex;

            flex-direction: column;

            gap: 10px;

            min-width: 0;

            height: 570px;

            scrollbar-gutter: stable;
        }

        /* ===== ОБЩИЙ СТИЛЬ СООБЩЕНИЙ ===== */

        .message {

            padding: 12px;

            border-radius: 10px;

            margin-bottom: 15px;

            white-space: pre-wrap;

            word-break: break-word;

            max-width: 75%;

            
        }

        /* ===== СООБЩЕНИЕ ПОЛЬЗОВАТЕЛЯ ===== */

        .user {

            align-self: flex-end;

            background: var(--teacher-orange-500);

            color: white;

            max-width: 75%;
        }

        /* ===== СООБЩЕНИЕ AI ===== */

        .assistant {

            align-self: flex-start;

            background: transparent;

            border: none;

            max-width: 75%;

            padding-left: 0;
        }


        /* ===== ПОЛЯ ВВОДА ===== */

        textarea {

            display: block;

            width: 100%;

            padding: 13px 55px 13px 48px;

            border-radius: 18px;

            box-sizing: border-box;

            min-height: 46px;

            max-height: 220px;

            overflow-y: hidden;

            resize: none;

            font-size: 15px;

            line-height: 20px;

            font-family: 'Inter', sans-serif;

            border: 1px solid var(--teacher-gray-200);

            background: white;

            transition:
                border-color 0.2s,
                box-shadow 0.2s;

            outline: none;
        }

        textarea:focus {

            border-color: var(--teacher-orange-500);

            box-shadow:
                0 0 0 3px
                rgba(233, 138, 58, 0.16);
        }

        /* ===== ВЫПАДАЮЩИЕ СПИСКИ ===== */

        select {

            padding: 5px;

            margin-right: 10px;
        }

        /* ===== КНОПКА ===== */

        button {

            padding: 10px 20px;

            border: none;

            border-radius: 8px;

            background: var(--teacher-orange-500);

            color: white;

            cursor: pointer;

            font-size: 16px;

            cursor: pointer;

            transition: 0.2s;
        }

        .send-button:hover {

           background: var(--teacher-green-100);

           color: var(--teacher-green-800);

           transform: translateY(-50%);
        }

        .send-button:disabled {

            opacity: 0.5;

            cursor: not-allowed;
        }

        .input-area {

            position: sticky;

            bottom: 0;

            display: flex;

            flex-direction: column;

            gap: 8px;

            padding: 0;

            background: transparent;

            border: none;

            border-radius: 0;

            box-shadow: none;
        }

        .input-wrapper {

            position: relative;

            width: 100%;

            background: white;

            border: 1px solid var(--teacher-gray-200);

            border-radius: 18px;

            box-shadow:
                0 2px 8px rgba(0,0,0,0.04);
        }

        .send-button,
        .upload-button {

            position: absolute;

            top: 50%;

            width: var(--teacher-icon-size);

            min-width: var(--teacher-icon-size);

            height: var(--teacher-icon-size);

            min-height: var(--teacher-icon-size);

            box-sizing: border-box;

            border-radius: var(--teacher-icon-radius);

            line-height: 1;

            cursor: pointer;

            display: flex;

            align-items: center;

            justify-content: center;

            transform: translateY(-50%);

            box-shadow: var(--teacher-table-shadow);

            transition:
                background 0.2s,
                color 0.2s,
                box-shadow 0.2s,
                transform 0.2s;
            
            padding: 0;

        }

        .send-button {

            right: 8px;

            border: 1px solid var(--teacher-green-100);

            background: var(--teacher-green-50);

            color: var(--teacher-green-800);
        }

        .upload-button {

            left: 8px;

            border: 1px solid var(--teacher-table-border);

            background: var(--teacher-table-cell-bg);

            color: var(--teacher-table-text);

            z-index: 2;
        }

        .send-button svg,
        .upload-button svg {

            width: 18px;

            height: 18px;

            display: block;

            flex: 0 0 auto;
        }

        .send-button svg *,
        .upload-button svg * {

            stroke-width: 1.9;

            vector-effect: non-scaling-stroke;
        }

        .upload-button:hover {

            background: var(--teacher-table-header-bg);
        }
    
        /* ===== ЭФФЕКТ НАВЕДЕНИЯ ===== */

        button:hover {

            background: var(--teacher-orange-500);
        }

        /* ===== БЕЛЫЕ БЛОКИ ===== */

        .block {

            background: white;

            padding: 15px;

            border-radius: 10px;

            margin-bottom: 20px;

            box-shadow: 0 0 10px rgba(0,0,0,0.1);
        }



/*Точечки */

.message.loading {

    padding: 2px 10px 2px 0px;

    margin-bottom: 4px;

    line-height: 0.8;

    min-height: 14px;
    
}

.typing {

    display: inline-flex;

    align-items: center;

    margin-left: -24px;

    gap: 4px;
}

.typing span {

    width: 6px;

    height: 6px;

    border-radius: 50%;

    background: var(--teacher-gray-500);

    animation: bounce 1.2s infinite;
}

.typing span:nth-child(2) {

    animation-delay: 0.2s;
}

.typing span:nth-child(3) {

    animation-delay: 0.4s;
}

@keyframes bounce {

    0%, 80%, 100% {

        transform: scale(0.7);

        opacity: 0.5;
    }

    40% {

        transform: scale(1);

        opacity: 1;
    }
}

/*Превью*/
#imagePreview {

    display: flex;

    gap: 8px;

    flex-wrap: wrap;
}

.upload-error {

    color: var(--teacher-red-800);

    font-size: 13px;

    line-height: 1.35;

    padding: 4px 2px 0;
}

.preview-image {

    width: 72px;

    height: 72px;

    border-radius: 12px;

    border: 1px solid var(--teacher-gray-200);

    object-fit: cover;
}

.preview-file {

    max-width: 180px;

    min-height: 40px;

    padding: 10px 12px;

    border: 1px solid var(--teacher-gray-200);

    border-radius: 12px;

    background: var(--teacher-orange-50);

    color: var(--teacher-orange-800);

    font-size: 13px;

    line-height: 1.25;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}

.preview-wrapper {

    position: relative;

    display: inline-block;
}

.remove-image {

    position: absolute;

    top: -6px;

    right: -6px;

    width: 20px;

    height: 20px;

    border: none;

    border-radius: 50%;

    background: var(--teacher-black);

    color: white;

    cursor: pointer;

    font-size: 14px;

    line-height: 20px;

    padding: 0;
}

/* Баббл пользователя */
/* Общий user-bubble */
.message.user {
    background: var(--teacher-orange-100);
    color: var(--teacher-orange-800);
    max-width: 75%;
    border-radius: 14px;
    padding: 8px 12px;
    margin: 4px 0;
    display: flex;
    flex-direction: column; /* текст сверху, картинка снизу */
    gap: 6px;
    word-break: break-word;
}

/* Текст внутри bubble */
.message.user .text-content {
    white-space: pre-wrap;
}

/* Картинка внутри bubble */
.message.user .image-message {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
    display: block;
    align-self: flex-end;
}

.message.user .message-file {
    max-width: 220px;
    padding: 8px 10px;
    border: 1px solid rgba(124, 58, 8, 0.18);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.45);
    font-size: 13px;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    align-self: flex-end;
}

/* Left task panel */
.left-column > .block {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 14px;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.left-column > .block > h3,
.left-column > .block > .block,
.left-column > .block > #select_block {
    width: 100%;
}

.left-column > .block > h3 {
    order: 0;
}

.left-column h3 {
    margin: 0 0 12px;
    color: var(--teacher-black);
    font-size: 14px;
    font-weight: 600;
}

.left-column > .block > .block {
    order: 2;
    flex: 0 1 auto;
    box-sizing: border-box;
    max-height: calc(
        var(--right-work-height)
        - var(--select-block-height)
        - 14px
    );
    overflow: hidden;
    padding: 18px;
    margin: 0;
    border: 1px solid var(--teacher-gray-200);
    border-radius: 14px;
    background: white;
    box-shadow: 0 2px 10px rgba(17, 24, 39, 0.05);
}

[hidden] {
    display: none !important;
}

.teacher-page .teacher-topbar-actions .teacher-link {
    display: none !important;
}

.left-column > .block > .block {
    display: flex;
    flex-direction: column;
}

.left-column #problem_view {
    order: 1;
    flex: 0 1 auto;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--teacher-black);
}

.left-column #problem_view {
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    line-height: 1.5;
    overflow-wrap: anywhere;
    scrollbar-gutter: stable;
}

.left-column #problem_view ol {
    box-sizing: border-box;
    max-width: 100%;
    padding-left: 24px;
}

.left-column #problem_view li {
    overflow-wrap: anywhere;
}

.left-column #problem_view mjx-container {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.left-column #problem_view .problem-data-table-wrap {
    max-width: 100%;
    margin-top: 12px;
    overflow-x: auto;
    border: 1px solid var(--teacher-table-border);
    border-radius: 6px;
    background: var(--teacher-table-cell-bg);
    box-shadow: var(--teacher-table-shadow);
}

.left-column #problem_view .problem-data-table {
    width: 100%;
    min-width: 680px;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--teacher-table-text);
    font-size: 13px;
}

.left-column #problem_view .problem-data-table th,
.left-column #problem_view .problem-data-table td {
    height: 36px;
    padding: 6px 10px;
    border-right: 1px solid var(--teacher-table-divider);
    border-bottom: 1px solid var(--teacher-table-divider);
    box-sizing: border-box;
    text-align: center;
    white-space: nowrap;
}

.left-column #problem_view .problem-data-table th {
    background: var(--teacher-table-header-bg);
    font-weight: 700;
}

.left-column #problem_view .problem-data-table td {
    background: var(--teacher-table-cell-bg);
}

.left-column #problem_view .problem-data-table tr > :last-child {
    border-right: 0;
}

.left-column #problem_view .problem-data-table tbody tr:last-child > * {
    border-bottom: 0;
}

.left-column #problem_image {
    order: 2;
    flex: 0 0 auto;
    margin-top: 12px !important;
}

.left-column #problem_image img {
    max-height: 220px;
    object-fit: contain;
    border: 1px solid var(--teacher-gray-200);
}

#select_block {
    order: 1;
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0;
    padding: 18px;
    box-sizing: border-box;
    border: 1px solid var(--teacher-gray-200);
    border-radius: 14px;
    background: white;
    box-shadow: 0 2px 10px rgba(17, 24, 39, 0.05);
}

#select_block h3 {
    width: 100%;
    margin-bottom: 10px;
}

#select_block select {
    flex: 0 0 auto;
    width: 54px;
    min-height: 40px;
    margin: 0;
    padding: 8px 10px;
    box-sizing: border-box;
    border: 1px solid var(--teacher-gray-200);
    border-radius: 10px;
    background: white;
    color: var(--teacher-black);
    font: inherit;
}

#select_block #group_select {
    width: 104px;
}

.progress-block {
    width: 100%;
    margin-top: 18px;
    padding: 0;
    box-sizing: border-box;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.progress-table {
    max-height: 360px;
    overflow-y: auto;
    overflow-x: auto;
    padding-right: 2px;
    --progress-row-label-width: 54px;
    --progress-cell-width: 48px;
    --progress-cell-height: 32px;
}

.progress-grid {
    min-width: max-content;
}

.progress-matrix {
    display: inline-flex;
    flex-direction: column;
    min-width: max-content;
    width: max-content;
    border: 1px solid var(--teacher-table-border);
    border-radius: var(--teacher-table-radius);
    overflow: visible;
    box-shadow: var(--teacher-table-shadow);
}

.progress-matrix-head {
    display: grid;
    grid-template-columns: var(--progress-row-label-width) max-content;
    align-items: center;
    background: var(--teacher-table-header-bg);
    border-bottom: 1px solid var(--teacher-table-divider);
    border-radius: var(--teacher-table-radius) var(--teacher-table-radius) 0 0;
}

.progress-section {
    display: grid;
    grid-template-columns: var(--progress-row-label-width) max-content;
    align-items: center;
    background: var(--teacher-table-cell-bg);
    border-bottom: 1px solid var(--teacher-table-divider);
}

.progress-section:last-child {
    border-bottom: 0;
}

.progress-section-title {
    position: sticky;
    left: 0;
    z-index: 2;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-sizing: border-box;
    color: var(--teacher-table-muted);
    font-size: 13px;
    font-weight: 600;
    border-right: 1px solid var(--teacher-table-border);
    background: var(--teacher-table-header-bg);
}

.progress-matrix-head .progress-section-title,
.progress-footer-title {
    z-index: 3;
}

.progress-footer {
    display: grid;
    grid-template-columns: var(--progress-row-label-width) max-content;
    align-items: stretch;
    background: var(--teacher-table-header-bg);
    border-bottom: 0;
    border-radius: 0 0 var(--teacher-table-radius) var(--teacher-table-radius);
}

.progress-footer-title {
    min-height: calc(var(--progress-cell-height) * 2);
}

.progress-footer-rows {
    display: grid;
    grid-template-rows: repeat(2, var(--progress-cell-height));
}

.progress-footer-rows .progress-cells:first-child {
    border-bottom: 1px solid var(--teacher-table-divider);
}

.progress-cells {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: var(--progress-cell-width);
    align-items: center;
    gap: 0;
    width: max-content;
}

.progress-number,
.progress-cell-placeholder {
    width: var(--progress-cell-width);
    height: var(--progress-cell-height);
    box-sizing: border-box;
}

.progress-number {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--teacher-table-muted);
    font-size: 12px;
    font-weight: 600;
    background: var(--teacher-table-header-bg);
    border-right: 1px solid var(--teacher-table-divider);
}

.progress-number:last-child {
    border-right: 0;
}

.progress-cell {
    position: relative;
    width: var(--progress-cell-width);
    height: var(--progress-cell-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
    border: 0;
    border-right: 1px solid var(--teacher-table-divider);
    border-radius: 0;
    background: var(--teacher-table-cell-bg);
    color: var(--teacher-table-muted);
    font-size: 12px;
}

.progress-cell:hover {
    background: var(--teacher-table-muted-bg);
    color: var(--teacher-table-text);
    transform: none;
}

.progress-cell.current {
    box-shadow: inset 0 0 0 2px var(--teacher-orange-500);
}

.progress-cell.tried {
    background: var(--teacher-orange-50);
    color: var(--teacher-orange-800);
}

.progress-cell.passed {
    background: var(--teacher-green-50);
    color: var(--teacher-green-800);
}

.progress-cell-placeholder {
    box-sizing: border-box;
    border-right: 1px solid var(--teacher-table-divider);
    background: var(--teacher-table-cell-bg);
    color: var(--teacher-table-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.progress-major-start {
    border-left: 1px solid var(--teacher-table-border);
}

.progress-matrix-head .progress-major-start {
    border-left-color: var(--teacher-table-border);
    background: var(--teacher-table-header-bg);
}

.progress-cell span {
    font-size: 12px;
    font-weight: 600;
}

.progress-summary-cell {
    width: var(--progress-cell-width);
    height: var(--progress-cell-height);
    box-sizing: border-box;
    border-right: 1px solid var(--teacher-table-divider);
    background: var(--teacher-table-header-bg);
    color: var(--teacher-table-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.progress-topic-summary-cell {
    grid-column: span var(--progress-topic-span);
    width: auto;
    flex-direction: column;
    gap: 1px;
    font-size: 11px;
    line-height: 1.05;
}

.progress-override-marker {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--teacher-table-cell-bg);
}

.progress-override-pass {
    background: var(--teacher-green-600);
}

.progress-override-fail {
    background: var(--teacher-red-600);
}

.progress-empty {
    padding: 12px;
    color: var(--teacher-table-muted);
    font-size: 14px;
}

:root {
    --teacher-black: #111827;
    --teacher-gray-25: #ffffff;
    --teacher-gray-50: #f9fafb;
    --teacher-gray-100: #f9fafb;
    --teacher-gray-200: #e5e7eb;
    --teacher-gray-500: #6b7280;
    --teacher-red-50: #fee2e2;
    --teacher-red-100: #fecaca;
    --teacher-red-600: #dc2626;
    --teacher-red-800: #991b1b;
    --teacher-green-50: #dcfce7;
    --teacher-green-100: #bbf7d0;
    --teacher-green-600: #16a34a;
    --teacher-green-800: #166534;
    --teacher-orange-50: #fff7ed;
    --teacher-orange-100: #ffefd8;
    --teacher-orange-500: #e98a3a;
    --teacher-orange-800: #7c3a08;
    --teacher-table-border: var(--teacher-gray-200);
    --teacher-table-divider: var(--teacher-gray-200);
    --teacher-table-header-bg: var(--teacher-gray-50);
    --teacher-table-muted-bg: var(--teacher-gray-100);
    --teacher-table-cell-bg: var(--teacher-gray-25);
    --teacher-table-text: var(--teacher-black);
    --teacher-table-muted: var(--teacher-gray-500);
    --teacher-table-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
    --teacher-table-radius: 10px;
    --teacher-table-cell-height: 34px;
    --teacher-table-cell-x: 10px;
    --teacher-icon-size: 32px;
    --teacher-icon-radius: 10px;
}

.teacher-page {
    max-width: 1600px;
}

.teacher-page .progress-empty {
    color: var(--teacher-table-muted);
}

.teacher-page-title {
    margin-bottom: 18px;
}

.teacher-topbar {
    margin-bottom: 16px;
}

.teacher-topbar-main {
    flex: 0 0 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.teacher-topbar-title {
    color: var(--teacher-table-text);
    font-size: 17px;
    font-weight: 700;
}

.teacher-topbar-subtitle {
    margin-top: 2px;
    color: var(--teacher-table-muted);
    font-size: 13px;
}

.teacher-topbar-actions {
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.teacher-tabs {
    flex: 1 1 auto;
    min-width: 260px;
    max-width: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.teacher-tabs::-webkit-scrollbar {
    display: none;
}

.teacher-tab {
    min-height: 34px;
    padding: 7px 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--teacher-table-muted);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.teacher-tab:hover {
    color: var(--teacher-table-text);
    background: transparent;
}

.teacher-tab.is-active {
    color: var(--teacher-table-text);
    background: transparent;
    box-shadow: inset 0 -2px 0 var(--teacher-orange-500);
}

.teacher-panel {
    padding: 18px;
    box-sizing: border-box;
    border: 1px solid var(--teacher-table-border);
    border-radius: 14px;
    background: var(--teacher-table-cell-bg);
    box-shadow: var(--teacher-table-shadow);
}

@media (max-width: 900px) {
    .teacher-topbar {
        flex-wrap: wrap;
    }

    .teacher-tabs {
        order: 3;
        flex-basis: 100%;
        width: 100%;
        min-width: 0;
        max-width: none;
        justify-content: flex-start;
        padding-top: 2px;
    }
}

.teacher-panel + .teacher-panel {
    margin-top: 18px;
}

.teacher-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.teacher-panel-header h2 {
    margin: 0;
    font-size: 20px;
}

.teacher-panel-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}

.teacher-panel-header p,
#teacher_students_summary,
#teacher_progress_summary {
    margin: 4px 0 0;
    color: var(--teacher-table-muted);
    font-size: 13px;
}

#teacher_journal_summary {
    color: var(--teacher-table-muted);
    font-size: 13px;
}

.teacher-students-table {
    overflow-x: auto;
}

.teacher-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 12px;
}

.teacher-journal-panel .teacher-filters {
    display: none;
}

.teacher-journal-panel > .teacher-panel-header {
    display: none;
}

.teacher-legacy-single-panel {
    display: none !important;
}

.teacher-active-class-card {
    margin-bottom: 14px;
}

.teacher-active-class-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--teacher-table-border);
    border-radius: var(--teacher-table-radius);
    font-size: 13px;
}

.teacher-active-class-table th,
.teacher-active-class-table td {
    height: var(--teacher-table-cell-height);
    padding: 8px var(--teacher-table-cell-x);
    box-sizing: border-box;
    border-bottom: 1px solid var(--teacher-table-divider);
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.teacher-active-class-table th:nth-child(1),
.teacher-active-class-table td:nth-child(1) {
    width: 34%;
}

.teacher-active-class-table th:nth-child(2),
.teacher-active-class-table td:nth-child(2) {
    width: 22%;
}

.teacher-active-class-table th:nth-child(3),
.teacher-active-class-table td:nth-child(3),
.teacher-active-class-table th:nth-child(4),
.teacher-active-class-table td:nth-child(4) {
    width: 82px;
}

.teacher-active-class-table th:last-child,
.teacher-active-class-table td:last-child {
    width: 232px;
}

.teacher-active-class-table th {
    background: var(--teacher-table-header-bg);
    color: var(--teacher-table-muted);
    font-size: 12px;
    font-weight: 700;
}

.teacher-active-class-table td {
    background: var(--teacher-table-cell-bg);
    color: var(--teacher-table-text);
}

.teacher-active-class-table tbody tr:last-child td {
    border-bottom: 0;
}

.teacher-active-class-action {
    min-width: 64px;
}

.teacher-active-class-action + .teacher-active-class-action {
    min-width: 132px;
}

.teacher-journal-result {
    display: block;
    min-height: 18px;
    margin: -4px 0 10px;
    color: var(--teacher-table-muted);
    font-size: 13px;
}

.teacher-classes-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--teacher-table-border);
    border-radius: var(--teacher-table-radius);
    overflow: hidden;
}

.teacher-create-class-panel {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--teacher-table-divider);
}

.teacher-class-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 120px auto;
    align-items: center;
    gap: 16px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--teacher-table-divider);
    background: var(--teacher-table-cell-bg);
}

.teacher-class-row:last-child {
    border-bottom: 0;
}

.teacher-class-row:hover {
    background: var(--teacher-table-header-bg);
}

.teacher-class-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.teacher-class-main strong {
    overflow: hidden;
    color: var(--teacher-table-text);
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.teacher-class-main span,
.teacher-class-meta {
    color: var(--teacher-table-muted);
    font-size: 13px;
}

.teacher-class-meta {
    text-align: right;
    white-space: nowrap;
}

.teacher-class-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.teacher-delete-class-button {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--teacher-table-border);
    border-radius: var(--teacher-icon-radius);
    background: var(--teacher-table-cell-bg);
    color: var(--teacher-table-muted);
    font: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.teacher-delete-class-button:hover {
    color: var(--teacher-red-800);
    background: var(--teacher-red-50);
}

.teacher-admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.teacher-admin-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 14px;
    padding: 4px;
    border: 1px solid var(--teacher-table-border);
    border-radius: var(--teacher-table-radius);
    background: var(--teacher-table-header-bg);
}

[data-legacy-admin-tab],
[data-teacher-view="admin"] > .teacher-panel-header,
.teacher-admin-tabs {
    display: none !important;
}

.teacher-admin-tab {
    min-height: 30px;
    padding: 5px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--teacher-table-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.teacher-admin-tab.active {
    background: var(--teacher-table-cell-bg);
    color: var(--teacher-orange-800);
    box-shadow: var(--teacher-table-shadow);
}

.teacher-admin-section {
    min-width: 0;
}

.teacher-admin-section-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.teacher-admin-section-header h3 {
    margin: 0;
    font-size: 15px;
}

.teacher-llm-settings {
    display: grid;
    grid-template-columns: minmax(240px, 420px) auto minmax(0, 1fr);
    gap: 10px;
    align-items: end;
}

.teacher-llm-settings label {
    display: grid;
    gap: 5px;
    color: var(--teacher-table-muted);
    font-size: 12px;
    font-weight: 600;
}

.teacher-llm-settings select {
    width: 100%;
    height: var(--teacher-table-cell-height);
    padding: 0 var(--teacher-table-cell-x);
    border: 1px solid var(--teacher-table-border);
    border-radius: 6px;
    background: var(--teacher-table-cell-bg);
    color: var(--teacher-table-text);
    font: inherit;
}

.teacher-llm-settings .teacher-secondary-button {
    min-height: var(--teacher-table-cell-height);
}

.teacher-llm-result {
    min-height: var(--teacher-table-cell-height);
    display: flex;
    align-items: center;
    color: var(--teacher-table-muted);
    font-size: 13px;
}

@media (max-width: 720px) {
    .teacher-llm-settings {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .teacher-llm-result {
        grid-column: 1 / -1;
    }
}

.teacher-admin-section-header-stacked {
    align-items: stretch;
    flex-direction: column;
    justify-content: flex-start;
}

.teacher-admin-teacher-form,
.teacher-admin-school-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) auto minmax(120px, auto);
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.teacher-admin-teacher-form input,
.teacher-admin-school-form input {
    min-height: 34px;
    padding: 7px 10px;
    box-sizing: border-box;
    border: 1px solid var(--teacher-table-border);
    border-radius: var(--teacher-icon-radius);
    background: var(--teacher-table-cell-bg);
    font: inherit;
    font-size: 13px;
}

.teacher-admin-school-form input {
    grid-column: 1 / 3;
}

#admin_teacher_result,
#admin_school_result,
#admin_class_add_result,
#admin_import_result {
    color: var(--teacher-table-muted);
    font-size: 13px;
    white-space: nowrap;
}

.teacher-admin-status-error {
    color: var(--teacher-red-800) !important;
}

.teacher-admin-filter {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    color: var(--teacher-table-muted);
    font-size: 13px;
}

.teacher-admin-filters {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(190px, 240px) minmax(180px, 1fr) 80px 80px 190px;
    align-items: end;
    gap: 10px;
    width: 100%;
}

.teacher-admin-filter select {
    width: 100%;
    min-height: 32px;
    padding: 5px 34px 5px 9px;
    border: 1px solid var(--teacher-table-border);
    border-radius: var(--teacher-icon-radius);
    background: var(--teacher-table-cell-bg);
    font: inherit;
    font-size: 13px;
}

.teacher-admin-filter:nth-child(1) {
    grid-column: 1;
}

.teacher-admin-filter:nth-child(2) {
    grid-column: 2;
}

.teacher-admin-th-filter {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
}

.teacher-admin-th-filter span {
    padding: 0 9px;
    color: var(--teacher-table-muted);
    font-size: 12px;
    font-weight: 700;
}

.teacher-admin-th-filter select {
    width: 100%;
    min-height: 30px;
    padding: 5px 34px 5px 8px;
    border: 1px solid var(--teacher-table-border);
    border-radius: var(--teacher-icon-radius);
    background: var(--teacher-table-cell-bg);
    font: inherit;
    font-size: 13px;
    font-weight: 400;
}

.teacher-admin-filter select,
.teacher-admin-th-filter select,
.teacher-admin-inline-select,
.teacher-filters select {
    appearance: none;
    background-color: var(--teacher-table-cell-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M6 8l4 4 4-4' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-repeat: no-repeat;
}

.teacher-admin-table {
    overflow-x: auto;
    border: 1px solid var(--teacher-table-border);
    border-radius: var(--teacher-table-radius);
}

.teacher-admin-classes-table {
    overflow-x: hidden;
}

.teacher-admin-list {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    box-sizing: border-box;
    font-size: 13px;
}

.teacher-admin-classes-list {
    min-width: 0;
}

.teacher-admin-list .admin-class-col-school {
    width: 30%;
}

.teacher-admin-list .admin-class-col-class {
    width: 30%;
}

.teacher-admin-list .admin-class-col-base {
    width: 16%;
}

.teacher-admin-list .admin-class-col-actions {
    width: 24%;
}

.teacher-admin-classes-list-admin .admin-class-col-school {
    width: 22%;
}

.teacher-admin-classes-list-admin .admin-class-col-class {
    width: 24%;
}

.teacher-admin-classes-list-admin .admin-class-col-base {
    width: 12%;
}

.teacher-admin-classes-list-admin .admin-class-col-actions {
    width: 16%;
}

.teacher-admin-classes-list-admin .admin-class-col-teacher {
    width: 26%;
}

.teacher-admin-list th,
.teacher-admin-list td {
    height: var(--teacher-table-cell-height);
    padding: 8px var(--teacher-table-cell-x);
    box-sizing: border-box;
    border-bottom: 1px solid var(--teacher-table-divider);
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
}

.teacher-admin-list th {
    background: var(--teacher-table-header-bg);
    color: var(--teacher-table-muted);
    font-size: 12px;
    font-weight: 700;
    vertical-align: top;
}

.teacher-admin-th-plain {
    display: inline-block;
    padding: 1px 9px 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.teacher-admin-cell-text {
    display: block;
    overflow: hidden;
    padding: 0 9px;
    text-overflow: ellipsis;
}

.teacher-admin-class-cell {
    display: flex;
    align-items: center;
    gap: 7px;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding-left: 9px;
}

.teacher-admin-class-cell .teacher-admin-cell-text {
    flex: 1 1 auto;
    padding: 0;
}

.teacher-admin-school-cell,
.teacher-admin-teacher-cell {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding-left: 9px;
}

.teacher-admin-school-cell .teacher-admin-cell-text,
.teacher-admin-teacher-cell .teacher-admin-cell-text {
    flex: 1 1 auto;
    padding: 0;
}

.teacher-admin-teachers-list .teacher-admin-cell-text,
.teacher-admin-teachers-list .teacher-admin-teacher-cell {
    padding-left: 0;
    padding-right: 0;
}

.teacher-admin-class-buttons {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    min-width: 0;
}

.teacher-admin-icon-button,
.teacher-student-icon-button,
.teacher-admin-action-save,
.teacher-admin-action-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: var(--teacher-icon-size);
    min-width: var(--teacher-icon-size);
    max-width: var(--teacher-icon-size);
    height: var(--teacher-icon-size);
    min-height: var(--teacher-icon-size);
    padding: 0;
    border: 1px solid var(--teacher-table-border);
    border-radius: var(--teacher-icon-radius);
    background: var(--teacher-table-cell-bg);
    color: var(--teacher-orange-800);
    font: inherit;
    font-size: 0;
    line-height: 1;
    box-shadow: var(--teacher-table-shadow);
    cursor: pointer;
}

.teacher-icon-svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.teacher-admin-icon-button:hover,
.teacher-student-icon-button:hover {
    background: var(--teacher-orange-50);
}

.teacher-admin-reset-password:hover,
.teacher-reset-student-password:hover {
    color: var(--teacher-orange-800);
}

.teacher-remove-student {
    color: var(--teacher-red-800);
}

.teacher-remove-student:hover {
    background: var(--teacher-red-50);
    color: var(--teacher-red-800);
}

.teacher-admin-class-name-edit {
    display: grid;
    grid-template-columns: minmax(58px, 0.6fr) minmax(52px, 1fr);
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.teacher-admin-class-count {
    color: var(--teacher-table-muted);
    font-weight: 500;
}

.teacher-admin-class-journal-button {
    flex: 0 0 auto;
    margin-left: auto;
    min-height: 32px;
    min-width: 112px;
    padding: 6px 12px;
    border: 1px solid var(--teacher-table-border);
    border-radius: var(--teacher-icon-radius);
    background: var(--teacher-orange-50);
    color: var(--teacher-orange-800);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--teacher-table-shadow);
    cursor: pointer;
    white-space: nowrap;
}

.teacher-admin-list .teacher-admin-class-journal-button {
    min-width: 88px;
    padding-right: 9px;
    padding-left: 9px;
}

.teacher-admin-class-journal-button:hover {
    background: var(--teacher-orange-100);
}

.teacher-admin-class-journal-button:disabled {
    border-color: var(--teacher-table-border);
    background: var(--teacher-table-muted-bg);
    color: var(--teacher-table-muted);
    box-shadow: none;
    cursor: default;
}

.teacher-admin-list tr:last-child td {
    border-bottom: 0;
}

.teacher-admin-row-archived td {
    background: var(--teacher-table-muted-bg);
    color: var(--teacher-table-muted);
}

.teacher-admin-row-archived .teacher-admin-cell-text,
.teacher-admin-row-archived .teacher-admin-inline-select {
    color: var(--teacher-table-muted);
}

.teacher-admin-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.teacher-hidden-file-input {
    display: none;
}

.teacher-admin-action {
    min-height: 32px;
    min-width: 112px;
    padding: 6px 12px;
    border: 1px solid var(--teacher-table-border);
    border-radius: var(--teacher-icon-radius);
    background: var(--teacher-table-cell-bg);
    color: var(--teacher-table-text);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--teacher-table-shadow);
    cursor: pointer;
}

.teacher-admin-list .teacher-admin-action {
    min-width: 88px;
    padding-right: 10px;
    padding-left: 10px;
    white-space: nowrap;
}

.teacher-admin-actions-add-class {
    flex-wrap: wrap;
    max-width: none;
    overflow: visible;
}

.teacher-admin-actions-add-class .teacher-admin-action {
    min-width: auto;
    padding-right: 9px;
    padding-left: 9px;
}

.teacher-admin-action:hover {
    background: var(--teacher-table-header-bg);
}

.teacher-admin-action:disabled {
    border-color: var(--teacher-table-border);
    background: var(--teacher-table-muted-bg);
    color: var(--teacher-table-muted);
    box-shadow: none;
    cursor: default;
}

.teacher-admin-action-archive {
    border-color: var(--teacher-red-100);
    background: var(--teacher-red-50);
    color: var(--teacher-red-800);
}

.teacher-admin-action-archive:hover {
    background: var(--teacher-red-100);
}

.teacher-admin-action-restore {
    border-color: var(--teacher-green-100);
    background: var(--teacher-green-50);
    color: var(--teacher-green-800);
}

.teacher-admin-action-restore:hover {
    background: var(--teacher-green-100);
}

.teacher-admin-action-save {
    border-color: var(--teacher-green-100);
    background: var(--teacher-green-50);
    color: var(--teacher-green-800);
}

.teacher-admin-action-save:hover {
    background: var(--teacher-green-100);
}

.teacher-admin-action-cancel {
    border-color: var(--teacher-red-100);
    background: var(--teacher-red-50);
    color: var(--teacher-red-800);
}

.teacher-admin-action-cancel:hover {
    background: var(--teacher-red-100);
}

.teacher-admin-action-save,
.teacher-admin-action-cancel,
.teacher-admin-list .teacher-admin-action-save,
.teacher-admin-list .teacher-admin-action-cancel,
.teacher-admin-actions-add-class .teacher-admin-action-save,
.teacher-admin-actions-add-class .teacher-admin-action-cancel {
    flex: 0 0 var(--teacher-icon-size);
    width: var(--teacher-icon-size);
    min-width: var(--teacher-icon-size);
    max-width: var(--teacher-icon-size);
    height: var(--teacher-icon-size);
    min-height: var(--teacher-icon-size);
    padding: 0;
}

.teacher-admin-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.teacher-admin-create-class-toggle {
    margin-bottom: 0;
}

.teacher-admin-inline-select {
    min-height: 30px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 5px 34px 5px 8px;
    border: 1px solid var(--teacher-table-border);
    border-radius: var(--teacher-icon-radius);
    background-color: var(--teacher-table-cell-bg);
    font: inherit;
    font-size: 13px;
    font-weight: 400;
}

.teacher-admin-inline-input {
    min-height: 30px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 5px 8px;
    border: 1px solid var(--teacher-table-border);
    border-radius: var(--teacher-icon-radius);
    background-color: var(--teacher-table-cell-bg);
    font: inherit;
    font-size: 13px;
    font-weight: 400;
}

.teacher-admin-inline-select option {
    background: var(--teacher-table-cell-bg);
    color: var(--teacher-table-text);
    font: inherit;
}

.teacher-filters label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--teacher-table-muted);
    font-size: 13px;
}

.teacher-filters select {
    min-height: 34px;
    padding: 7px 34px 7px 10px;
    border: 1px solid var(--teacher-table-border);
    border-radius: var(--teacher-icon-radius);
    background-color: var(--teacher-table-cell-bg);
    font: inherit;
    font-size: 14px;
}

.teacher-import-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.teacher-import-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 12px;
    align-items: end;
}

.teacher-import-teacher-field {
    grid-column: 1;
}

.teacher-import-school-field {
    grid-column: 1;
}

.teacher-import-common-field {
    min-width: 0;
}

.teacher-import-file-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.teacher-import-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.teacher-single-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
}

.teacher-import-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--teacher-table-muted);
    font-size: 13px;
}

.teacher-import-form input,
.teacher-import-form select,
.teacher-single-form input {
    min-height: 38px;
    padding: 8px 10px;
    box-sizing: border-box;
    border: 1px solid var(--teacher-table-border);
    border-radius: var(--teacher-icon-radius);
    background: var(--teacher-table-cell-bg);
    font: inherit;
    font-size: 14px;
}

#teacher_import_result {
    color: var(--teacher-table-muted);
    font-size: 13px;
    white-space: nowrap;
}

.teacher-student-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.teacher-student-cell strong {
    min-width: 0;
    flex: 1 1 auto;
}

.teacher-journal-table {
    overflow: auto;
    max-height: min(520px, 56vh);
    border: 1px solid var(--teacher-table-border);
    border-radius: var(--teacher-table-radius);
}

.teacher-journal {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.teacher-journal th,
.teacher-journal td {
    height: var(--teacher-table-cell-height);
    padding: 0 var(--teacher-table-cell-x);
    box-sizing: border-box;
    border-right: 1px solid var(--teacher-table-divider);
    border-bottom: 1px solid var(--teacher-table-divider);
    text-align: center;
    white-space: nowrap;
}

.teacher-journal th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--teacher-table-header-bg);
    color: var(--teacher-table-muted);
    font-size: 12px;
    font-weight: 700;
}

.teacher-journal thead tr:nth-child(2) th {
    top: 34px;
}

.teacher-block-heading {
    border-bottom-color: var(--teacher-table-border);
}

.teacher-task-heading {
    min-width: 44px;
}

.teacher-chapter-summary-heading {
    min-width: 58px;
    color: var(--teacher-table-text);
    background: var(--teacher-table-muted-bg);
}

.teacher-journal .teacher-student-column {
    position: sticky;
    left: 0;
    z-index: 1;
    width: 240px;
    max-width: 240px;
    text-align: left;
    background: var(--teacher-table-cell-bg);
    overflow: hidden;
    text-overflow: ellipsis;
}

.teacher-journal th.teacher-student-column {
    z-index: 3;
    background: var(--teacher-table-header-bg);
}

.teacher-journal .teacher-total-column {
    position: sticky;
    left: 240px;
    z-index: 1;
    min-width: 64px;
    font-weight: 700;
    background: var(--teacher-table-cell-bg);
}

.teacher-journal th.teacher-total-column {
    z-index: 3;
    background: var(--teacher-table-header-bg);
}

.teacher-journal-cell {
    position: relative;
    min-width: 44px;
    color: var(--teacher-table-muted);
    background: var(--teacher-table-cell-bg);
    font-weight: 700;
}

.teacher-journal-cell.tried {
    background: var(--teacher-orange-50);
    color: var(--teacher-orange-800);
}

.teacher-journal-cell.passed {
    background: var(--teacher-green-50);
    color: var(--teacher-green-800);
}

.teacher-clickable-cell {
    cursor: pointer;
}

.teacher-clickable-cell:hover {
    box-shadow: inset 0 0 0 2px var(--teacher-orange-500);
}

.teacher-override-marker {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--teacher-table-cell-bg);
}

.teacher-override-pass {
    background: var(--teacher-green-600);
}

.teacher-override-fail {
    background: var(--teacher-red-600);
}

.teacher-chapter-summary {
    min-width: 58px;
}

.teacher-chapter-summary strong,
.teacher-chapter-summary span {
    display: block;
    line-height: 1.15;
}

.teacher-chapter-summary strong {
    font-size: 12px;
}

.teacher-chapter-summary span {
    margin-top: 2px;
    font-size: 10px;
    font-weight: 600;
    opacity: 0.72;
}

.teacher-journal .teacher-major-start {
    border-left: 1px solid var(--teacher-table-border);
}

.teacher-dialog[hidden] {
    display: none;
}

.teacher-dialog {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.teacher-dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.24);
}

.teacher-dialog-panel {
    position: relative;
    z-index: 1;
    width: min(360px, 100%);
    padding: 18px;
    box-sizing: border-box;
    border: 1px solid var(--teacher-table-border);
    border-radius: 14px;
    background: var(--teacher-table-cell-bg);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}

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

.teacher-dialog-header h2 {
    margin: 0;
    font-size: 18px;
}

.teacher-dialog-close {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--teacher-table-border);
    border-radius: var(--teacher-icon-radius);
    background: var(--teacher-table-muted-bg);
    color: var(--teacher-table-muted);
    font-size: 20px;
    line-height: 26px;
    cursor: pointer;
}

.teacher-dialog-panel p {
    margin: 8px 0;
    color: var(--teacher-table-muted);
}

.teacher-dialog-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
    color: var(--teacher-table-muted);
    font-size: 13px;
}

.teacher-dialog-field input {
    min-height: 34px;
    padding: 7px 10px;
    box-sizing: border-box;
    border: 1px solid var(--teacher-table-border);
    border-radius: var(--teacher-icon-radius);
    background: var(--teacher-table-cell-bg);
    color: var(--teacher-table-text);
    font: inherit;
    font-size: 13px;
}

.teacher-dialog-result {
    display: block;
    min-height: 18px;
    margin-top: 10px;
    color: var(--teacher-table-muted);
    font-size: 13px;
}

.teacher-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.teacher-confirm-actions {
    justify-content: flex-end;
}

.teacher-confirm-accept {
    border-color: var(--teacher-table-border);
    background: var(--teacher-orange-50);
    color: var(--teacher-orange-800);
}

.teacher-confirm-accept:hover {
    background: var(--teacher-orange-100);
}

.teacher-pass-button {
    background: var(--teacher-green-50);
    color: var(--teacher-green-800);
}

.teacher-fail-button {
    background: var(--teacher-red-50);
    color: var(--teacher-red-800);
}

.teacher-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.teacher-table th,
.teacher-table td {
    height: var(--teacher-table-cell-height);
    padding: 8px var(--teacher-table-cell-x);
    border-bottom: 1px solid var(--teacher-table-divider);
    text-align: left;
    white-space: nowrap;
}

.teacher-table th {
    color: var(--teacher-table-muted);
    font-size: 12px;
    font-weight: 700;
    background: var(--teacher-table-header-bg);
}

.teacher-table tbody tr {
    cursor: pointer;
}

.teacher-table tbody tr:hover,
.teacher-row-selected {
    background: var(--teacher-table-header-bg);
}

.teacher-detail[hidden] {
    display: none;
}

.teacher-class-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--teacher-table-muted);
    font-size: 13px;
    white-space: nowrap;
}

.teacher-class-filter select {
    min-width: 110px;
    padding: 8px 10px;
    border: 1px solid var(--teacher-table-border);
    border-radius: var(--teacher-icon-radius);
    background: var(--teacher-table-cell-bg);
    font: inherit;
    font-size: 14px;
}

@media (max-width: 900px) {
    .layout {
        flex-direction: column;
    }

    .left-column,
    .right-column {
        width: 100%;
    }

    #select_block select {
        flex-basis: 100%;
        width: 100%;
    }
}
