﻿:root {
    --text: #1d2136;
    --muted: #6a7188;
    --accent: #5b6cff;
    --accent-soft: rgba(91, 108, 255, .14);
    --glass: rgba(255, 255, 255, .55);
    --glass-strong: rgba(255, 255, 255, .82);
    --glass-border: rgba(255, 255, 255, .75);
    --shadow: 0 8px 32px rgba(50, 60, 130, .12);
    --cell: rgba(255, 255, 255, .45);
    --cell-none: rgba(110, 120, 150, .10);
    --line: rgba(110, 120, 160, .22);
    --head: rgba(236, 239, 255, .96);
    --lbl: rgba(91, 108, 255, .07);
    --off: rgba(110, 120, 150, .12);
    --week: rgba(91, 108, 255, .55);
    --base: #eef1fb;
    --blob1: rgba(120, 140, 255, .42);
    --blob2: rgba(255, 150, 200, .30);
    --blob3: rgba(90, 210, 200, .28);
}

[data-bs-theme="dark"] {
    --text: #e8eaf5;
    --muted: #9aa1bd;
    --accent: #8090ff;
    --accent-soft: rgba(128, 144, 255, .20);
    --glass: rgba(255, 255, 255, .07);
    --glass-strong: rgba(28, 32, 54, .86);
    --glass-border: rgba(255, 255, 255, .12);
    --shadow: 0 8px 32px rgba(0, 0, 0, .35);
    --cell: rgba(255, 255, 255, .06);
    --cell-none: rgba(255, 255, 255, .03);
    --line: rgba(255, 255, 255, .10);
    --head: rgba(30, 34, 60, .97);
    --lbl: rgba(128, 144, 255, .10);
    --off: rgba(255, 255, 255, .05);
    --week: rgba(128, 144, 255, .60);
    --base: #0d0f1a;
    --blob1: rgba(90, 105, 230, .35);
    --blob2: rgba(190, 90, 160, .22);
    --blob3: rgba(50, 150, 150, .22);
}

html {
    min-height: 100%;
}

body {
    --bs-body-color: var(--text);
    --bs-secondary-color: var(--muted);
    min-height: 100vh;
    color: var(--text);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    background: radial-gradient(700px 480px at 8% -5%, var(--blob1), transparent 70%), radial-gradient(640px 460px at 100% 10%, var(--blob2), transparent 70%), radial-gradient(700px 500px at 50% 110%, var(--blob3), transparent 70%), var(--base);
    background-attachment: fixed;
}

a {
    color: var(--accent);
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
    }

h1, h2, h3, h4, h5 {
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--text);
}

/* ---------- Верхняя панель ---------- */
.glass-nav {
    --bs-navbar-color: var(--muted);
    --bs-navbar-hover-color: var(--text);
    --bs-navbar-active-color: var(--text);
    --bs-navbar-brand-color: var(--text);
    --bs-navbar-brand-hover-color: var(--text);
    background: var(--glass);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
    border-bottom: 1px solid var(--glass-border);
}

    .glass-nav .navbar-brand {
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: .5rem;
        color: var(--text);
    }

    .glass-nav .nav-link {
        color: var(--muted);
    }

        .glass-nav .nav-link:hover {
            color: var(--text);
            text-decoration: none;
        }

    .glass-nav .navbar-text {
        color: var(--text);
    }

.brand-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #ff8fc7);
    box-shadow: 0 2px 8px var(--accent-soft);
}

/* ---------- Стеклянные поверхности ---------- */
.card, .list-group-item {
    background: var(--glass);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    color: inherit;
}

.list-group {
    gap: .5rem;
}

.list-group-item {
    border-radius: 14px !important;
}

.alert {
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

/* ---------- Формы и кнопки ---------- */
.form-control, .form-select {
    background-color: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text);
}

    .form-control:focus, .form-select:focus {
        background-color: var(--glass-strong);
        color: var(--text);
        border-color: var(--accent);
        box-shadow: 0 0 0 .22rem var(--accent-soft);
    }

    .form-control::placeholder {
        color: var(--muted);
        opacity: .8;
    }

.btn {
    border-radius: 12px;
    font-weight: 500;
}

    .btn:hover {
        text-decoration: none;
    }

.btn-primary {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: #4857e6;
    --bs-btn-hover-border-color: #4857e6;
    --bs-btn-active-bg: #3f4ed0;
    --bs-btn-active-border-color: #3f4ed0;
    --bs-btn-disabled-bg: var(--accent);
    --bs-btn-disabled-border-color: var(--accent);
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
}

.btn-glass {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

    .btn-glass:hover, .btn-glass:focus {
        background: var(--glass-strong);
        color: var(--text);
        border-color: var(--accent);
    }

/* ---------- Окна ---------- */
.modal-content {
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    backdrop-filter: blur(22px) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    color: var(--text);
}

.modal-header, .modal-footer {
    border-color: var(--glass-border);
}

.modal-backdrop {
    --bs-backdrop-opacity: .28;
}

.hw-view {
    white-space: pre-line;
    overflow-wrap: anywhere;
    font-size: 1.05rem;
}

.thumb {
    max-height: 90px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
}

.file-row {
    margin-bottom: .4rem;
    overflow-wrap: anywhere;
}

.cmt {
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--cell);
    margin-bottom: 6px;
}

.cmt-text {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* ---------- Таблица как в Google Таблицах ---------- */
.grid-wrap {
    position: relative;
    overflow: auto;
    max-height: calc(100vh - 200px);
    background: var(--glass);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

table.sched {
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    width: 100%;
    min-width: calc(var(--cols) * 150px + 44px);
}

.sched th, .sched td {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.sched .mon {
    border-left: 2px solid var(--week);
}

/* Шапка с датами */
.sched th.day-h {
    position: sticky;
    top: 0;
    z-index: 3;
    width: 150px;
    padding: 10px 6px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    color: var(--text);
    background: var(--head);
}

    .sched th.day-h.today {
        background: var(--accent);
        color: #fff;
    }

    .sched th.day-h.clickable {
        cursor: pointer;
    }

        .sched th.day-h.clickable:hover {
            filter: brightness(.96);
        }

/* Левая колонка с номерами уроков */
.sched th.corner, .sched td.num {
    position: sticky;
    left: 0;
    width: 44px;
    text-align: center;
    color: var(--muted);
    font-weight: 600;
    font-size: 13px;
    background: var(--head);
}

.sched th.corner {
    top: 0;
    z-index: 5;
}

.sched td.num {
    z-index: 2;
    vertical-align: middle;
}

/* Строка с названием предмета */
.sched td.lbl {
    height: 30px;
    padding: 5px 6px;
    text-align: center;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    background: var(--lbl);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .sched td.lbl.edit {
        cursor: pointer;
    }

        .sched td.lbl.edit:hover {
            background: var(--accent-soft);
            color: var(--text);
        }

    .sched td.lbl.empty.edit::after {
        content: "+";
        opacity: .35;
        font-size: 14px;
    }

/* Клетка с ДЗ: растёт вниз, шрифт сам не меняется */
.sched td.cell {
    height: 64px;
    padding: 8px 10px 4px;
    vertical-align: middle;
    background: var(--cell);
    cursor: pointer;
    transition: background .12s ease;
}

    .sched td.cell:hover {
        background: var(--accent-soft);
    }

    .sched td.cell.none {
        background: var(--cell-none);
        color: var(--muted);
    }

    .sched td.cell.pending {
        outline: 2px dashed #e8a020;
        outline-offset: -3px;
    }

.sched td.cell-empty {
    height: 64px;
    background: transparent;
}

/* Выходной и праздничный день */
.sched td.off {
    vertical-align: top;
    padding-top: 22px;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    background: var(--off);
}

    .sched td.off.holiday {
        background: rgba(255, 170, 60, .14);
        color: #b9740f;
    }

.ct {
    text-align: center;
    line-height: 1.25;
    font-size: 15px;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

    .ct.sz0 {
        font-size: 11px;
    }

    .ct.sz1 {
        font-size: 13px;
    }

    .ct.sz2 {
        font-size: 15px;
    }

    .ct.sz3 {
        font-size: 18px;
    }

    .ct.sz4 {
        font-size: 22px;
    }

.cell-meta {
    height: 14px;
    text-align: right;
    font-size: 10px;
    color: var(--muted);
}

    .cell-meta span {
        margin-left: 6px;
    }
/* ---------- Дополнения: тёмные полосы прокрутки, перетягивание размеров ---------- */
[data-bs-theme="dark"] {
    color-scheme: dark;
}

[data-bs-theme="light"] {
    color-scheme: light;
}

.grid-wrap {
    scrollbar-width: thin;
    scrollbar-color: var(--week) transparent;
}

.sched th.day-h::first-letter {
    text-transform: uppercase;
}

.sched td.cell, .sched td.cell-empty {
    height: 44px;
}

.col-resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 100%;
    cursor: col-resize;
    z-index: 6;
    touch-action: none;
    user-select: none;
}

    .col-resizer:hover {
        background: var(--accent-soft);
    }

.row-resizer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 8px;
    cursor: row-resize;
    z-index: 6;
    touch-action: none;
    user-select: none;
}

    .row-resizer:hover {
        background: var(--accent-soft);
    }
/* ---------- Переключатель триместров ---------- */
.term-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.term-btn {
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-weight: 600;
    font-size: 17px;
    color: #fff !important;
    text-decoration: none !important;
    background: rgba(90, 71, 160, .85);
    border: 1px solid rgba(255, 255, 255, .18);
    transition: transform .12s ease, filter .12s ease;
}

    .term-btn:hover {
        filter: brightness(1.12);
        transform: translateY(-1px);
    }

.term-open {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    animation: termOpen .3s ease both;
}

.term-btn.part {
    background: rgba(163, 71, 160, .85);
}

    .term-btn.part.active {
        background: #b955b6;
        box-shadow: 0 0 0 2px rgba(255, 255, 255, .55), 0 4px 14px rgba(185, 85, 182, .45);
    }

.term-label {
    height: 42px;
    padding: 0 22px;
    display: inline-flex;
    align-items: center;
    border-radius: 21px;
    background: rgba(196, 111, 195, .9);
    color: #20102a;
    font-weight: 600;
    white-space: nowrap;
}

@keyframes termOpen {
    from {
        max-width: 0;
        opacity: 0;
    }

    to {
        max-width: 420px;
        opacity: 1;
    }
}

/* ---------- Объявления на главной ---------- */
.feed-item {
    cursor: pointer;
    transition: transform .12s ease;
}

    .feed-item:hover {
        transform: translateY(-1px);
    }

.pub-item {
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--cell);
    margin-bottom: 8px;
}

.pub-old, .pub-new {
    white-space: pre-line;
    overflow-wrap: anywhere;
    padding: 6px 10px;
    border-radius: 8px;
    margin: 2px 0 6px;
}

.pub-old {
    background: rgba(255, 90, 90, .13);
}

.pub-new {
    background: rgba(70, 200, 120, .15);
}
/* ---------- Кнопки триместров в стиле стекла ---------- */
.term-btn {
    color: var(--text) !important;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: none;
}

    .term-btn:hover {
        background: var(--glass-strong);
        filter: none;
    }

    .term-btn.part {
        background: var(--glass);
    }

        .term-btn.part.active {
            background: var(--accent-soft);
            border-color: var(--accent);
            color: var(--accent) !important;
            box-shadow: none;
        }

.term-label {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--muted);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

/* ---------- Ячейка предмета: цифра, название, время и кабинет ---------- */
.sched td.lbl {
    height: 38px;
    padding: 4px 8px;
}

.lbl-in {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

    .lbl-in .lnum {
        min-width: 40px;
        text-align: left;
        color: var(--accent);
        font-weight: 700;
        font-size: 14px;
    }

    .lbl-in .lname {
        flex: 1;
        min-width: 0;
        text-align: center;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .lbl-in .lmeta {
        min-width: 40px;
        text-align: right;
        font-size: 9.5px;
        line-height: 1.15;
        font-weight: 500;
        color: var(--muted);
        white-space: nowrap;
    }

.sched td.lbl.cancelled .lname {
    text-decoration: line-through;
    opacity: .65;
}

.sched td.lbl.draft {
    outline: 2px dashed #e8a020;
    outline-offset: -3px;
}

.draft-hint {
    font-size: 11px;
    color: var(--muted);
}

/* Страница «Изменить расписание» */
.sched.tpl td.lbl {
    height: 58px;
}

.sched.tpl td.num {
    vertical-align: middle;
}

/* Объявления: кнопка удаления */
.feed-del {
    text-decoration: none;
}

    .feed-del:hover {
        text-decoration: underline;
    }
/* ---------- Текст ДЗ с форматированием ---------- */
.ct, .hw-view {
    white-space: normal;
}

    .ct p, .ct div, .hw-view p, .hw-view div {
        margin: 0;
    }

.hw-rich table {
    border-collapse: collapse;
    margin: 4px auto;
}

.hw-rich td, .hw-rich th {
    border: 1px solid var(--line);
    padding: 3px 8px;
    min-width: 26px;
}

.hw-rich ul, .hw-rich ol {
    margin: 2px 0;
    padding-left: 20px;
    text-align: left;
}

.hw-rich hr {
    margin: 6px 0;
}

/* ---------- Редактор текста ---------- */
.rte-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
}

.rte-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 9px;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}

    .rte-btn:hover {
        background: var(--glass-strong);
        border-color: var(--accent);
    }

.rte-select {
    height: 30px;
    border-radius: 9px;
    border: 1px solid var(--glass-border);
    background: var(--glass-strong);
    color: var(--text);
    font-size: 13px;
}

.rte-num {
    width: 54px;
    height: 30px;
    border-radius: 9px;
    border: 1px solid var(--glass-border);
    background: var(--glass-strong);
    color: var(--text);
    text-align: center;
}

.rte-color {
    position: relative;
    width: 30px;
    height: 30px;
    margin: 0;
    border-radius: 9px;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 700;
}

    .rte-color input {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        cursor: pointer;
    }

.rte-hl {
    background: #ffe066;
    color: #222;
    padding: 0 4px;
    border-radius: 3px;
}

.rte-body {
    min-height: 140px;
    max-height: 40vh;
    overflow: auto;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--glass-strong);
    outline: none;
    overflow-wrap: anywhere;
}

    .rte-body:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 .22rem var(--accent-soft);
    }

    .rte-body:empty::before {
        content: attr(data-placeholder);
        color: var(--muted);
    }

/* ---------- Ячейка предмета: название целиком, время и кабинет под ним ---------- */
.sched td.lbl {
    height: auto;
    padding: 6px 10px;
    text-align: left;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

    .sched td.lbl.empty {
        text-align: center;
        height: 38px;
    }

.lbl-in {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

    .lbl-in .lnum {
        min-width: 12px;
        text-align: left;
        color: var(--accent);
        font-weight: 700;
        font-size: 14px;
        line-height: 1.25;
    }

.lbody {
    flex: 1;
    min-width: 0;
}

.lbl-in .lname {
    flex: none;
    min-width: 0;
    text-align: left;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-weight: 600;
    font-size: 12.5px;
    line-height: 1.25;
    color: var(--text);
}

.lbl-in .lmeta {
    min-width: 0;
    text-align: left;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 500;
    color: var(--muted);
    white-space: normal;
}
/* «Урока не будет»: красное зачёркивание, ДЗ не трогаем */
.sched td.lbl.cancelled .lname,
.sched td.lbl.cancelled .lmeta {
    text-decoration: line-through;
    text-decoration-color: #e5484d;
    text-decoration-thickness: 2px;
    opacity: .85;
}

.sched.tpl td.lbl {
    height: auto;
    min-height: 58px;
}

/* ---------- Отметка «я сделал(а) ДЗ» ---------- */
.sched td.cell {
    position: relative;
}

.done-btn {
    position: absolute;
    left: 6px;
    bottom: 5px;
    width: 20px;
    height: 20px;
    padding: 0;
    border-radius: 50%;
    border: 1.5px solid var(--muted);
    background: transparent;
    color: #fff;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: .55;
}

    .done-btn:hover {
        opacity: 1;
        border-color: var(--accent);
    }

.sched td.cell.done {
    background: rgba(70, 200, 120, .14);
}

    .sched td.cell.done .ct {
        opacity: .5;
    }

    .sched td.cell.done .done-btn {
        background: #3fb871;
        border-color: #3fb871;
        opacity: 1;
    }

    .sched td.cell.done .cell-meta::before {
        content: "✓ сделано ";
        color: #3fb871;
        font-weight: 600;
    }

/* ---------- Подсветка при «Перейти к предмету» ---------- */
@keyframes flashGlow {
    0% {
        background-position: 160% 0;
        filter: brightness(1.35);
        box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 0 var(--accent-soft);
    }

    50% {
        filter: brightness(1.3);
        box-shadow: inset 0 0 0 2px var(--accent), 0 0 22px 4px var(--accent-soft);
    }

    100% {
        background-position: -60% 0;
        filter: brightness(1);
        box-shadow: inset 0 0 0 2px transparent, 0 0 0 0 transparent;
    }
}

.sched td.flash, .sched th.flash {
    background-image: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, .55) 50%, transparent 75%);
    background-size: 250% 100%;
    background-repeat: no-repeat;
    animation: flashGlow 3s ease-in-out both;
}

.sched td.flash {
    position: relative;
    z-index: 2;
}

/* ---------- Окно подтверждения публикации ---------- */
.pc-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    margin-bottom: 6px;
    padding: 9px 12px;
    text-align: left;
    color: var(--text);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    cursor: pointer;
}

    .pc-item:hover {
        background: var(--accent-soft);
        border-color: var(--accent);
    }

    .pc-item .pc-sub {
        margin-left: auto;
        font-size: 12px;
        color: var(--muted);
    }

/* ---------- Аватары и профиль ---------- */
.avatar-sm, .avatar-xs, .avatar-lg {
    border-radius: 50%;
    object-fit: cover;
    flex: none;
}

.avatar-sm {
    width: 30px;
    height: 30px;
}

.avatar-xs {
    width: 22px;
    height: 22px;
    font-size: 11px;
}

.avatar-lg {
    width: 110px;
    height: 110px;
    font-size: 40px;
}

.avatar-ph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.nav-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 1rem;
    color: var(--text);
    text-decoration: none;
}

    .nav-user:hover {
        color: var(--accent);
        text-decoration: none;
    }
/* ---------- Чат ---------- */
.chat-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 12px;
    height: calc(100vh - 130px);
    height: calc(100dvh - 130px);
    min-height: 420px;
}

.chat-panel {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.chat-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.chat-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
}

.chat-tabs {
    display: flex;
    gap: 6px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
}

.chat-tab {
    white-space: nowrap;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
}

    .chat-tab:hover {
        background: var(--glass-strong);
    }

    .chat-tab.active {
        background: var(--accent-soft);
        border-color: var(--accent);
        color: var(--accent);
        font-weight: 600;
    }

.chat-badge {
    display: inline-block;
    min-width: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #e5484d;
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
}

.chat-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 12px;
}

.chat-day {
    text-align: center;
    margin: 10px 0 6px;
    font-size: 12px;
    color: var(--muted);
}

    .chat-day span {
        padding: 2px 10px;
        border-radius: 999px;
        background: var(--glass-strong);
    }

.chat-msg {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    padding: 4px 6px;
    border-radius: 12px;
}

    .chat-msg:hover {
        background: var(--glass-strong);
    }

    .chat-msg.tagged {
        background: var(--accent-soft);
    }

.chat-bubble {
    min-width: 0;
    flex: 1;
}

.chat-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.chat-author {
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text);
    text-decoration: none;
}

    .chat-author:hover {
        color: var(--accent);
    }

.chat-time {
    font-size: 11px;
    color: var(--muted);
}

.chat-del {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
}

.chat-msg:hover .chat-del {
    opacity: 1;
}

.chat-del:hover {
    color: #e5484d;
}

@media (hover: none) {
    .chat-del {
        opacity: .6;
    }
}

.chat-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 14.5px;
}

.mention {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

    .mention.me {
        background: var(--accent-soft);
        border-radius: 6px;
        padding: 0 3px;
    }

.chat-sys {
    margin: 10px auto;
    max-width: 520px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid var(--accent);
    background: var(--accent-soft);
}

.chat-sys-text {
    white-space: pre-line;
    font-size: 14px;
}

.chat-sys-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.chat-compose {
    padding: 8px 10px;
    border-top: 1px solid var(--line);
    position: relative;
}

.chat-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

    .chat-row textarea {
        flex: 1;
        resize: none;
        max-height: 140px;
        padding: 8px 12px;
        border-radius: 12px;
        border: 1px solid var(--glass-border);
        background: var(--glass-strong);
        color: var(--text);
        outline: none;
    }

        .chat-row textarea:focus {
            border-color: var(--accent);
            box-shadow: 0 0 0 .22rem var(--accent-soft);
        }

.chat-readonly {
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    padding: 6px;
}

.chat-mention {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 100%;
    margin-bottom: 4px;
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    z-index: 5;
}

.chat-mention-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

    .chat-mention-item:hover {
        background: var(--accent-soft);
    }

.chat-side {
    padding: 12px;
    overflow-y: auto;
    min-height: 0;
}

.chat-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 2px;
}

.chat-uname {
    flex: 1;
    min-width: 0;
    color: var(--text);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .chat-uname small {
        display: block;
        color: var(--muted);
        font-size: 11px;
    }

    .chat-uname:hover {
        color: var(--accent);
    }

.chat-at {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
}

    .chat-at:hover {
        color: var(--accent);
        border-color: var(--accent);
    }

.chat-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--muted);
    opacity: .45;
    flex: none;
}

    .chat-dot.on {
        background: #3fb871;
        opacity: 1;
    }

@media (max-width: 991.98px) {
    .chat-wrap {
        grid-template-columns: minmax(0, 1fr);
        height: calc(100dvh - 110px);
    }

    .chat-side {
        display: none;
        position: fixed;
        inset: 70px 10px 10px 10px;
        z-index: 1030;
        background: var(--glass-strong);
    }

        .chat-side.open {
            display: block;
        }
}
/* ---------- Чат 3.2: значки, мигание ---------- */
.nav-badge {
    display: inline-block;
    min-width: 18px;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 9px;
    background: #e5484d;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    vertical-align: middle;
}

    .nav-badge.pulse {
        animation: badgePulse 1.1s ease-in-out infinite;
    }

@keyframes badgePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(229, 72, 77, .75);
    }

    50% {
        transform: scale(1.2);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(229, 72, 77, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(229, 72, 77, 0);
    }
}

.nav-link.alert-feed {
    animation: navGlow 1.4s ease-in-out infinite;
}

@keyframes navGlow {
    0%, 100% {
        text-shadow: none;
    }

    50% {
        text-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent);
    }
}

.chat-tab.hot {
    border-color: var(--accent);
    animation: tabBlink 1.2s ease-in-out infinite;
}

@keyframes tabBlink {
    0%, 100% {
        background: var(--glass);
        box-shadow: none;
    }

    50% {
        background: var(--accent-soft);
        box-shadow: 0 0 14px 2px var(--accent-soft);
    }
}

@media (prefers-reduced-motion: reduce) {
    .nav-badge.pulse, .nav-link.alert-feed, .chat-tab.hot {
        animation: none;
    }
}

/* ---------- Чат 3.2: шапка, поле ввода ---------- */
.chat-head-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: none;
}

.chat-icon {
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    color: var(--text);
    font-size: 17px;
    cursor: pointer;
}

    .chat-icon:hover {
        border-color: var(--accent);
        background: var(--glass-strong);
    }

.chat-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.chat-chip {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 210px;
    padding: 4px 26px 4px 6px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    font-size: 12px;
}

    .chat-chip img {
        width: 34px;
        height: 34px;
        object-fit: cover;
        border-radius: 6px;
    }

    .chat-chip .nm {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .chat-chip button {
        position: absolute;
        top: 2px;
        right: 5px;
        border: 0;
        background: transparent;
        color: var(--muted);
        cursor: pointer;
    }

        .chat-chip button:hover {
            color: #e5484d;
        }

.chat-rec {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px solid #e5484d;
    background: rgba(229, 72, 77, .1);
}

    .chat-rec .dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #e5484d;
        animation: recBlink 1s infinite;
    }

@keyframes recBlink {
    50% {
        opacity: .25;
    }
}

/* ---------- Чат 3.2: вложения ---------- */
.chat-files {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-top: 4px;
}

.chat-img {
    display: block;
    max-width: 260px;
    max-height: 300px;
    border-radius: 12px;
}

.chat-video {
    display: block;
    width: 300px;
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    background: #000;
}

.chat-audio {
    font-size: 13px;
}

    .chat-audio audio {
        display: block;
        width: 260px;
        max-width: 100%;
        height: 36px;
        margin-top: 2px;
    }

.chat-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    color: var(--text);
    text-decoration: none;
}

    .chat-file:hover {
        border-color: var(--accent);
    }

    .chat-file span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .chat-file small {
        color: var(--muted);
    }

.mention-special {
    color: #f5a524;
    font-weight: 600;
}

/* ---------- Чат 3.2: настройка вкладок ---------- */
.tm-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding: 7px 8px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    cursor: pointer;
}

    .tm-row:hover {
        border-color: var(--accent);
    }

    .tm-row.active {
        border-color: var(--accent);
        background: var(--accent-soft);
    }

    .tm-row .name {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.tm-arrow {
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 7px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

    .tm-arrow:disabled {
        opacity: .3;
        cursor: default;
    }

.tm-users {
    max-height: 200px;
    overflow: auto;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
}
/* ---------- Непрочитанное в чате ---------- */
.chat-main {
    position: relative;
}

.chat-newline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    color: #e5484d;
    font-size: 12px;
    font-weight: 600;
}

    .chat-newline::before, .chat-newline::after {
        content: "";
        flex: 1;
        height: 1px;
        background: #e5484d;
        opacity: .6;
    }

.chat-jump {
    position: absolute;
    left: 50%;
    bottom: 84px;
    transform: translateX(-50%);
    z-index: 6;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--accent);
    background: var(--glass-strong);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .25);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.chat-readonly.muted {
    color: #e5484d;
}

.chat-at.on {
    color: #e5484d;
    border-color: #e5484d;
}

/* ---------- Новые объявления ---------- */
.feed-item {
    position: relative;
}

    .feed-item.is-new {
        border-color: var(--accent);
        animation: newPulse 2.2s ease-in-out infinite;
    }

        .feed-item.is-new::after {
            content: "НОВОЕ";
            position: absolute;
            top: -8px;
            left: 12px;
            padding: 1px 8px;
            border-radius: 999px;
            background: var(--accent);
            color: #fff;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: .04em;
        }

@keyframes newPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 var(--accent-soft);
    }

    50% {
        box-shadow: 0 0 16px 3px var(--accent-soft);
    }
}

@media (prefers-reduced-motion: reduce) {
    .feed-item.is-new {
        animation: none;
    }
}

/* ---------- Подробнее в ДЗ, ссылки ---------- */
.more-box {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px dashed var(--accent);
    background: var(--accent-soft);
}

.more-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}

.hw-rich a, .chat-text a {
    color: var(--accent);
    text-decoration: underline;
    overflow-wrap: anywhere;
}

/* ---------- Смайлики ---------- */
.chat-emoji {
    position: absolute;
    left: 10px;
    bottom: 100%;
    margin-bottom: 4px;
    width: 340px;
    max-width: calc(100% - 20px);
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    z-index: 6;
}

.em-tabs {
    display: flex;
    gap: 2px;
    padding: 6px;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
}

.em-tab {
    flex: none;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font-size: 19px;
    cursor: pointer;
}

    .em-tab:hover {
        background: var(--glass);
    }

    .em-tab.active {
        background: var(--accent-soft);
    }

.em-body {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    max-height: 220px;
    overflow-y: auto;
    padding: 6px;
}

.em-item {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .em-item:hover {
        background: var(--accent-soft);
    }

    .em-item img {
        width: 28px;
        height: 28px;
        object-fit: contain;
    }

.cemoji {
    width: 26px;
    height: 26px;
    object-fit: contain;
    vertical-align: middle;
}

.em-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
}

.em-card {
    text-align: center;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    font-size: 13px;
}

    .em-card img {
        width: 56px;
        height: 56px;
        object-fit: contain;
        display: block;
        margin: 0 auto 6px;
    }

/* ---------- Участники (admin) ---------- */
.mg-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--glass);
}

.mg-main {
    flex: 1;
    min-width: 200px;
}

.mg-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ---------- Карточки уведомлений ---------- */
.toast-stack {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 340px;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}

.toast-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 34px 10px 16px;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    pointer-events: auto;
    border: 1px solid var(--glass-border);
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    opacity: 0;
    transform: translateX(40px) scale(.96);
    transition: opacity .35s ease, transform .4s cubic-bezier(.2, .9, .3, 1.2);
}

    .toast-card.in {
        opacity: 1;
        transform: none;
    }

    .toast-card.out {
        opacity: 0;
        transform: translateX(60px) scale(.96);
        transition: opacity .3s ease, transform .35s ease;
    }

    .toast-card.mention {
        border-color: #f5a524;
        box-shadow: 0 0 0 1px #f5a524, 0 10px 30px rgba(0, 0, 0, .35);
    }

.tc-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
}

.tc-body {
    min-width: 0;
    flex: 1;
}

.tc-top {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 13.5px;
}

.tc-tab {
    margin-left: auto;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--glass);
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
}

.tc-flag {
    color: #f5a524;
    font-size: 12px;
    font-weight: 600;
}

.tc-text {
    font-size: 13.5px;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tc-hint {
    margin-top: 4px;
    font-size: 11px;
    color: var(--muted);
}

.tc-x {
    position: absolute;
    top: 6px;
    right: 8px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

@media (max-width: 575.98px) {
    .toast-stack {
        top: 70px;
        bottom: auto;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
    }

    .toast-card {
        transform: translateY(-30px) scale(.97);
    }

        .toast-card.out {
            transform: translateY(-40px);
        }
}

@media (prefers-reduced-motion: reduce) {
    .toast-card {
        transition: opacity .2s;
        transform: none;
    }
}
/* ---------- Смайлики: «+» и предложения ---------- */
.em-tab.em-plus {
    color: var(--accent);
    font-weight: 700;
    border: 1px dashed var(--accent);
}

.em-prop-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex: none;
}

/* ---------- «Расписание изменено, см. ИНФА» ---------- */
.sched-note {
    display: block;
    margin-top: 3px;
    text-decoration: none;
}

    .sched-note::before {
        content: attr(data-label);
        display: inline-block;
        padding: 1px 8px;
        border-radius: 999px;
        border: 1px solid #f5a524;
        background: rgba(245, 165, 36, .18);
        color: #f5a524;
        font-size: 10.5px;
        font-weight: 600;
        line-height: 1.5;
        white-space: normal;
    }

    .sched-note:hover::before {
        background: rgba(245, 165, 36, .32);
    }

.chat-sys.flash {
    animation: sysFlash 3s ease-in-out both;
}

@keyframes sysFlash {
    0%, 100% {
        box-shadow: none;
        filter: none;
    }

    15%, 60% {
        box-shadow: 0 0 0 2px var(--accent), 0 0 24px 6px var(--accent-soft);
        filter: brightness(1.3);
    }
}
/* Фото расписания в карточке ИНФА */
.chat-sys .chat-files {
    margin-top: 8px;
}

.chat-sys .chat-img {
    max-width: 100%;
    max-height: 420px;
}
/* Панель смайликов: все вкладки видны сразу */
.chat-emoji {
    width: 400px;
}

.em-tab {
    width: 32px;
    height: 32px;
    font-size: 18px;
}

.em-tabs {
    scrollbar-width: thin;
}
/* «см. подробнее» в клетке ДЗ */
.ct-more {
    margin-top: 2px;
    font-size: 11px;
    font-weight: 600;
    font-style: italic;
    color: var(--accent);
}