/* admin-w.css — общий CSS веб-админки (дизайн W — Notion Pro от parent-report-designer).
   Применяется ко всем 5 страницам: /admin/login.php, /admin/staff/login.php,
   /admin/student/, /admin/staff/ (главная), /admin/staff/reviews/ (таблица заливок).
   Один источник правды — все компоненты в этом файле. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0F0820;
    --bg-side: #150A2C;
    --surface: #221739;
    --surface-2: #2A1F44;
    --violet: #8B5CF6;
    --violet-bright: #A78BFA;
    --violet-deep: #6D28D9;
    --text: #ECE9F5;
    --text-dim: #C2B8DE;
    --muted: #7E769C;
    --border: #2A2249;
    --border-soft: #1E1736;
    --success: #4ADE80;
    --warning: #FBBF24;
    --info: #60A5FA;
    --error: #F87171;
    --error-bg: rgba(248, 113, 113, 0.1);
    --success-bg: rgba(74, 222, 128, 0.08);
    --warning-bg: rgba(251, 191, 36, 0.1);
    --info-bg: rgba(96, 165, 250, 0.1);
}

/* Фон на самом корне (не только body) — иначе при кросс-фейде View Transitions
   сквозь полупрозрачные кадры просвечивает дефолтный белый = светлая вспышка. */
html { scrollbar-gutter: stable; background: var(--bg); }

/* Межстраничный View Transition ВЫКЛЮЧЕН — навигация по сайдбару мгновенная,
   максимальная отзывчивость (по просьбе пользователя). Кросс-фейд остаётся
   только на переключении вкладок групп (SPA, в том же документе — там лага нет). */

/* Уважаем «уменьшить движение» — без анимаций (для SPA-перехода вкладок). */
@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) { animation: none !important; }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
}

body.layout-app { display: flex; }
body.layout-login { display: flex; align-items: center; justify-content: center; padding: 24px; }

a { color: inherit; }

/* ===== Sidebar (главная админки, таблица заливок, ЛК ученика) ===== */
.sidebar {
    width: 240px; background: var(--bg-side); border-right: 1px solid var(--border);
    padding: 16px 12px; flex-shrink: 0;
    display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: 0; height: 100vh;
    align-self: flex-start; overflow-y: auto;
    /* Сайдбар держится на месте при переходе — кросс-фейдится только контент. */
    view-transition-name: app-sidebar;
}
.ws-head { padding: 6px 10px; margin-bottom: 8px; }
.ws-logo { display: block; height: 56px; width: auto; }

.nav-grp {
    font-size: 10.5px; color: var(--muted); font-weight: 600;
    letter-spacing: 0.5px; text-transform: uppercase; padding: 14px 10px 6px;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 5px 10px; border-radius: 5px;
    color: var(--text-dim); text-decoration: none;
    font-size: 13.5px; cursor: pointer;
}
.nav-item:hover { background: var(--surface); }
.nav-item.active { background: var(--surface-2); color: var(--text); font-weight: 500; }
.nav-item .ico { font-size: 14px; opacity: 0.85; width: 18px; text-align: center; }
.nav-item .count {
    margin-left: auto; font-size: 11px; color: var(--muted);
    background: var(--surface); padding: 1px 6px; border-radius: 4px;
}
.nav-item.active .count { color: var(--violet-bright); background: rgba(139,92,246,0.2); }

.sidebar-footer {
    margin-top: auto; padding: 10px 8px 6px;
    border-top: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 10px;
}
/* Карточка пользователя — мягкий фон, чтобы блок ощущался единым. */
.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 10px;
    background: var(--surface);
}
.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, #FBBF24, #F472B6);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 14px; color: white; flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.sidebar-footer .name { flex: 1; min-width: 0; }
.sidebar-footer .name-l {
    font-size: 13.5px; font-weight: 600; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-footer .name-s {
    font-size: 11.5px; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Кнопка выхода — чистый «призрачный» стиль, краснеет на наведении. */
.logout-btn {
    display: flex; align-items: center; justify-content: center;
    padding: 9px 12px; border-radius: 9px;
    border: 1px solid var(--border); background: transparent;
    color: var(--text-dim); font-size: 14px; font-weight: 500; letter-spacing: 0.2px;
    text-decoration: none;
    transition: background 140ms, color 140ms, border-color 140ms;
}
.logout-btn:hover {
    background: var(--error-bg); color: var(--error);
    border-color: rgba(248, 113, 113, 0.45);
}

/* ===== Main + Topbar ===== */
/* overflow-x: clip — гасит горизонтальный скролл страницы от случайного
   sub-pixel/прозрачного выпирания в контенте. Видимый контент центрирован
   с запасом по краям, поэтому ничего не обрезается. clip (не hidden) не
   создаёт скролл-контейнер — вертикальный скролл и липкий сайдбар не страдают. */
.main { flex: 1; padding: 0; min-width: 0; overflow-x: clip; }

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 24px; border-bottom: 1px solid var(--border); background: var(--bg);
}
.breadcrumbs {
    font-size: 12.5px; color: var(--muted);
    display: flex; align-items: center; gap: 6px;
}
.breadcrumbs .sep { color: var(--border); }
.breadcrumbs strong { color: var(--text); font-weight: 500; }
.breadcrumbs a { color: var(--text-dim); text-decoration: none; transition: color 120ms; }
.breadcrumbs a:hover { color: var(--text); }
.topbar-r { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.topbar-r .chip { padding: 3px 9px; border-radius: 4px; background: var(--surface); color: var(--text-dim); }
.topbar-r a { color: var(--muted); text-decoration: none; padding: 4px 8px; border-radius: 4px; }
.topbar-r a:hover { color: var(--text-dim); background: var(--surface); }

.page { max-width: 1080px; margin: 0 auto; padding: 40px 40px 80px; }
.page-icon { font-size: 48px; line-height: 1; margin-bottom: 12px; }
.page h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; }
.page h2 { font-size: 20px; font-weight: 600; margin: 32px 0 14px; }
.page-desc { color: var(--text-dim); font-size: 14.5px; margin-bottom: 28px; }

/* ===== Login (центрированная карточка) ===== */
.login-card { width: 100%; max-width: 380px; }

.brand { text-align: center; margin-bottom: 32px; }
.brand-logo {
    display: inline-block; height: 96px; width: auto;
    margin-bottom: 14px;
    filter: drop-shadow(0 12px 30px rgba(139, 92, 246, 0.35));
}
.brand-sub { font-size: 13px; color: var(--text-dim); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 28px; }

.hint { text-align: center; margin-top: 18px; font-size: 12.5px; color: var(--muted); }
.hint a { color: var(--violet-bright); text-decoration: none; }

.page-footer { text-align: center; margin-top: 32px; font-size: 11.5px; color: var(--muted); }
.page-footer a { color: var(--muted); text-decoration: none; margin: 0 6px; }
.page-footer a:hover { color: var(--text-dim); }

/* ===== Forms ===== */
.field { margin-bottom: 16px; }
.field label {
    display: block; font-size: 12.5px; color: var(--text-dim);
    margin-bottom: 6px; font-weight: 500;
}
.field input, .field input[type=text], .field input[type=password], .field input[type=file] {
    width: 100%; padding: 10px 14px;
    background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
    color: var(--text); font-family: inherit; font-size: 14px;
    transition: border-color 0.15s;
}
.field input:focus { outline: none; border-color: var(--violet); background: var(--surface-2); }
.field input::placeholder { color: var(--muted); }
.field .field-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

.upload-form {
    padding: 18px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 10px;
    margin-bottom: 28px;
}

/* ===== Buttons ===== */
.btn {
    width: 100%; padding: 11px; border: none; border-radius: 6px;
    background: var(--violet); color: white;
    font-family: inherit; font-weight: 500; font-size: 14px;
    cursor: pointer; transition: background 0.15s;
}
.btn:hover { background: var(--violet-bright); }
.btn:active { background: var(--violet-deep); }

.btn-mini {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    padding: 5px 10px; min-width: 108px;
    border-radius: 5px; font-size: 12px; font-weight: 500;
    text-decoration: none; border: 1px solid var(--border);
    background: var(--surface); color: var(--text-dim); cursor: pointer;
    font-family: inherit; white-space: nowrap; transition: all 0.15s;
}
.btn-mini:hover { background: var(--surface-2); border-color: var(--violet); color: var(--text); }
.btn-mini.primary { background: var(--violet); border-color: var(--violet); color: white; }
.btn-mini.primary:hover { background: var(--violet-bright); }
.btn-mini.danger { min-width: auto; padding: 5px 8px; color: var(--error); border-color: rgba(248,113,113,0.3); background: var(--error-bg); }
.btn-mini.danger:hover { background: rgba(248,113,113,0.2); border-color: var(--error); }
.btn-mini-secondary { color: var(--muted); }

/* ===== Alerts (success/error/info/warning) ===== */
.alert {
    padding: 10px 14px; border-radius: 6px;
    font-size: 13px; margin-bottom: 24px;
    display: flex; align-items: flex-start; gap: 10px;
}
.alert .ico { flex-shrink: 0; font-size: 14px; line-height: 1.4; }
.alert.success { background: var(--success-bg); border: 1px solid rgba(74,222,128,0.25); color: var(--success); }
.alert.success::before { content: '✓ '; font-weight: 700; }
.alert.error { background: var(--error-bg); border: 1px solid rgba(248,113,113,0.3); color: var(--error); }
.alert.error::before { content: '⚠ '; font-weight: 700; }
.alert.info { background: var(--info-bg); border: 1px solid rgba(96,165,250,0.3); color: var(--info); }
.alert.warn { background: var(--warning-bg); border: 1px solid rgba(251,191,36,0.3); color: var(--warning); }
.alert.warn::before { content: '⚠ '; font-weight: 700; }

/* ===== Properties (page-meta таблица свойств) ===== */
.props {
    display: grid; grid-template-columns: 140px 1fr;
    gap: 4px 16px; font-size: 13px;
    margin-bottom: 28px; padding-bottom: 22px;
    border-bottom: 1px solid var(--border-soft);
}
.prop-k { color: var(--muted); padding: 4px 0; }
.prop-v { padding: 4px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag { padding: 2px 8px; border-radius: 4px; font-size: 11.5px; font-weight: 500; }
.tag.v { background: rgba(139,92,246,0.15); color: var(--violet-bright); }
.tag.g { background: rgba(74,222,128,0.12); color: var(--success); }
.tag.w { background: rgba(251,191,36,0.12); color: var(--warning); }

/* ===== Hero card (главная админки) ===== */
.hero-card {
    display: grid; grid-template-columns: auto 1fr auto;
    align-items: center; gap: 24px;
    padding: 28px 30px;
    background: linear-gradient(135deg, rgba(139,92,246,0.18) 0%, rgba(109,40,217,0.12) 100%);
    border: 1px solid rgba(139,92,246,0.35); border-radius: 14px;
    text-decoration: none; color: inherit;
    transition: all 0.2s;
    margin-bottom: 36px;
    position: relative; overflow: hidden;
}
.hero-card::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(139,92,246,0.25) 0%, transparent 70%);
    pointer-events: none;
}
.hero-card:hover {
    background: linear-gradient(135deg, rgba(139,92,246,0.25) 0%, rgba(109,40,217,0.18) 100%);
    border-color: var(--violet); transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(139,92,246,0.25);
}
.hero-icon {
    width: 64px; height: 64px; border-radius: 14px;
    background: linear-gradient(135deg, var(--violet) 0%, var(--violet-deep) 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(139,92,246,0.4);
    position: relative; z-index: 1;
}
.hero-text { min-width: 0; position: relative; z-index: 1; }
.hero-h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 12px; }
.hero-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-chip {
    display: inline-flex; align-items: center;
    padding: 4px 10px; border-radius: 100px;
    font-size: 12px; font-weight: 500;
}
.stat-chip.wait  { background: rgba(251,191,36,0.15); color: var(--warning); }
.stat-chip.work  { background: rgba(96,165,250,0.15); color: var(--info); }
.stat-chip.ready { background: rgba(74,222,128,0.12); color: var(--success); }
.hero-arrow {
    font-size: 24px; color: var(--violet-bright);
    position: relative; z-index: 1; transition: transform 0.2s;
}
.hero-card:hover .hero-arrow { transform: translateX(4px); }

/* ===== Section header + card grid (заготовка под будущие разделы) ===== */
.section-h {
    font-size: 11.5px; font-weight: 600; color: var(--muted);
    letter-spacing: 0.5px; text-transform: uppercase;
    margin-bottom: 14px; padding-bottom: 10px;
    border-bottom: 1px solid var(--border-soft);
}
.card-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.section-card {
    display: flex; flex-direction: column;
    padding: 18px 20px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    text-decoration: none; color: inherit;
    transition: all 0.15s; cursor: pointer;
    min-height: 110px;
}
.section-card:hover { background: var(--surface-2); border-color: var(--violet-deep); transform: translateY(-1px); }
.section-card.soon { opacity: 0.55; }
.section-card.soon:hover { transform: none; cursor: default; }
.card-icon { font-size: 24px; margin-bottom: 10px; }
.card-h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.card-desc { font-size: 12px; color: var(--muted); }
.card-soon-tag {
    display: inline-block; margin-top: auto;
    padding: 1px 7px; border-radius: 3px;
    background: var(--border); color: var(--muted);
    font-size: 10px; font-weight: 500; letter-spacing: 0.5px; text-transform: uppercase;
    align-self: flex-start;
}

/* ===== Toolbar / filter ===== */
.toolbar {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 14px; padding-bottom: 12px;
    border-bottom: 1px solid var(--border-soft);
}
.toolbar .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.filter-select {
    padding: 6px 12px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 5px;
    color: var(--text); font-family: inherit; font-size: 13px;
    cursor: pointer; min-width: 160px;
}
.filter-select:focus { outline: none; border-color: var(--violet); }
.toolbar .spacer { flex: 1; }
.toolbar .meta { font-size: 12px; color: var(--muted); }
.toolbar .meta strong { color: var(--text); }

/* ===== Table (заливки + история ученика) ===== */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
/* Блок истории заливок: при узком окне таблица скроллится внутри себя,
   а не растягивает всю страницу горизонтально. */
#history-block { overflow-x: auto; }
.table thead th {
    text-align: left; font-weight: 500; font-size: 11.5px;
    color: var(--muted); letter-spacing: 0.3px;
    padding: 9px 10px; border-bottom: 1px solid var(--border);
}
.table tbody tr:hover { background: var(--surface); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }

.student { display: flex; flex-direction: column; min-width: 0; }
.student-name { color: var(--text); font-weight: 500; font-size: 13.5px; }
.student-meta { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.student-meta .grp { color: var(--violet-bright); }

.file { color: var(--text); font-weight: 500; font-size: 13px; }
.file .ico { display: inline-block; margin-right: 8px; opacity: 0.7; vertical-align: middle; }
.when { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

.status {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 9px; border-radius: 4px;
    font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.status.wait       { background: rgba(251,191,36,0.12); color: var(--warning); }
.status.inprogress { background: rgba(96,165,250,0.12); color: var(--info); }
.status.ready      { background: rgba(74,222,128,0.12); color: var(--success); }
.seen-marker { display: inline-block; margin-left: 8px; font-size: 11px; color: var(--muted); }
.seen-marker.seen { color: var(--success); }

.actions { text-align: right; white-space: nowrap; }
/* Универсальный отступ между любыми двумя соседними детьми .actions —
   срабатывает на (a + a), (a + form), (form + a), (form + form). */
.actions > * + * { margin-left: 6px; }
.actions form { display: inline; }

.footnote {
    font-size: 11.5px; color: var(--muted);
    margin-top: 14px; padding: 10px 14px;
    background: var(--surface); border-radius: 6px;
    border-left: 2px solid var(--violet);
}
.footnote strong { color: var(--text-dim); font-weight: 500; }

/* ЕДИНОЕ ПРАВИЛО выравнивания: все таблицы админки стоят флешем по левой/правой
   линии страницы (убираем крайние отступы ячеек) — заголовки, текст таблиц и рамки
   боксов на одной вертикали, без «лесенки». Применяется ко всем страницам с .table. */
.page .table th:first-child, .page .table td:first-child { padding-left: 0; }
.page .table th:last-child,  .page .table td:last-child  { padding-right: 0; }

/* ===== Dropzone (форма заливки ученика, drag-and-drop) ===== */
.dropzone {
    display: block; position: relative; cursor: pointer;
    border: 2px dashed var(--border); border-radius: 8px;
    padding: 28px 20px; text-align: center;
    transition: border-color 0.2s, background 0.2s;
    background: var(--surface);
}
.dropzone:hover { border-color: var(--violet); background: var(--surface-2); }
.dropzone.dragging {
    border-color: var(--violet-bright); border-style: solid;
    background: rgba(139,92,246,0.12);
}
.dropzone.has-file {
    border-color: var(--success); border-style: solid;
    background: rgba(74,222,128,0.06);
}

/* Три состояния — idle/drop/filled. По умолчанию виден idle, при .dragging — drop, при .has-file — filled. */
.dropzone-state {
    display: none;
    min-height: 100px;
    flex-direction: column; align-items: center; justify-content: center;
}
.dropzone-state.idle { display: flex; }
.dropzone.dragging .dropzone-state.idle { display: none; }
.dropzone.dragging .dropzone-state.drop { display: flex; }
.dropzone.has-file .dropzone-state.idle,
.dropzone.has-file .dropzone-state.drop { display: none; }
.dropzone.has-file .dropzone-state.filled { display: flex; align-items: stretch; }

.dropzone-icon { font-size: 36px; line-height: 1; margin-bottom: 8px; transition: transform 0.2s; }
.dropzone-hint { font-size: 13.5px; color: var(--text-dim); line-height: 1.5; }
.dropzone-hint strong { color: var(--text); font-weight: 600; }
.dropzone-link { color: var(--violet-bright); text-decoration: underline; }

/* Idle — лёгкое пульсирование иконки чтобы привлечь внимание. */
@keyframes dropzone-pulse {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50%      { transform: scale(1.08); opacity: 1; }
}
.dropzone:not(.dragging):not(.has-file) .dropzone-state.idle .dropzone-icon {
    animation: dropzone-pulse 2.5s ease-in-out infinite;
}

/* Dragging — иконка приподнимается. */
.dropzone.dragging .dropzone-state.drop .dropzone-icon {
    transform: translateY(-4px) scale(1.15);
}

/* Filled — список файлов слева-направо (вертикально, начинаются сверху). */
.dropzone-state.filled { padding: 8px 0; }
.dropzone-filelist {
    display: flex; flex-direction: column; gap: 6px;
    width: 100%; max-width: 480px; margin: 0 auto;
    text-align: left;
}
.dropzone-fileitem {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px;
    background: var(--bg);
    border: 1px solid var(--border-soft); border-radius: 5px;
    font-size: 13px; color: var(--text);
}
.dropzone-fileitem .icon { flex-shrink: 0; opacity: 0.7; }
.dropzone-fileitem .name { flex: 1; word-break: break-all; min-width: 0; }
.dropzone-fileitem .size { flex-shrink: 0; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.dropzone-fileitem .remove {
    flex-shrink: 0;
    background: transparent; border: none; cursor: pointer;
    font-size: 16px; line-height: 1; color: var(--muted);
    padding: 2px 6px; border-radius: 4px;
    transition: all 0.15s;
}
.dropzone-fileitem .remove:hover { color: var(--error); background: rgba(248,113,113,0.1); }
.dropzone-addmore {
    margin-top: 10px; padding: 8px 0;
    font-size: 12.5px; color: var(--muted); text-align: center;
}
.dropzone-addmore .link { color: var(--violet-bright); text-decoration: underline; }
.dropzone-summary {
    margin-top: 8px; font-size: 12px; color: var(--muted); text-align: center;
}
.dropzone-summary strong { color: var(--text-dim); }

.dropzone-input {
    position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none;
}

/* ===== Group tabs (ЛК ученика — переключение между его группами) ===== */
.group-tabs {
    display: flex; flex-wrap: wrap; gap: 2px;
    margin: 0 0 22px;
    border-bottom: 1px solid var(--border);
}
.group-tab {
    padding: 10px 16px;
    font-size: 13.5px; font-weight: 500;
    color: var(--text-dim); text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
    margin-bottom: -1px;
}
.group-tab:hover { color: var(--text); background: var(--surface); }
.group-tab.active {
    color: var(--violet-bright);
    border-bottom-color: var(--violet);
    background: var(--surface);
}

/* ===== Mobile (≤920px) — sidebar в строку сверху, таблица в карточки ===== */
@media (max-width: 920px) {
    body.layout-app { flex-direction: column; }
    .sidebar {
        width: 100%; height: auto; position: static; overflow: visible;
        border-right: none; border-bottom: 1px solid var(--border);
        flex-direction: row; flex-wrap: wrap; align-content: flex-start;
        padding: 12px; gap: 8px;
    }
    .ws-head { width: 100%; margin-bottom: 0; }
    .nav-grp { display: none; }
    .sidebar-footer { width: 100%; margin-top: 0; }
    .page { padding: 28px 22px 60px; }

    .hero-card { grid-template-columns: auto 1fr; padding: 22px; }
    .hero-arrow { display: none; }

    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; padding: 12px; }
    /* Компактная карточка: имя ученика — заголовок строки (.tc-name), остальные поля
       компактно «текут» (подпись+значение в ряд, переносом), действия — отдельной строкой.
       Селектор .page .table перебивает по специфичности табличные .c/.sc (центровка). */
    .page .table tr {
        display: flex; flex-wrap: wrap; align-items: baseline;
        column-gap: 14px; row-gap: 3px;
        background: var(--surface); border: 1px solid var(--border);
        border-radius: 10px; margin-bottom: 10px; padding: 11px 14px;
    }
    .page .table td {
        display: inline-flex; align-items: baseline; gap: 5px;
        width: auto; border: none; padding: 0; text-align: left;
        font-size: 13px; color: var(--text-dim); overflow-wrap: anywhere;
    }
    .page .table td::before {
        content: attr(data-label); font-size: 9.5px; color: var(--muted);
        text-transform: uppercase; letter-spacing: 0.4px; font-weight: 500;
    }
    /* Имя — заголовок: на всю ширину, крупнее, без подписи. */
    .page .table td.tc-name { flex-basis: 100%; font-size: 15px; font-weight: 600; color: var(--text); }
    .page .table td.tc-name::before { display: none; }
    .page .table td.tc-name .student { flex-direction: row; gap: 8px; align-items: baseline; flex-wrap: wrap; }
    .page .table td.tc-name .student-meta { font-size: 12px; font-weight: 400; }
    /* Ранг (медаль/№) — слева на одной строке с именем. */
    .page .table td.tc-rank { flex: 0 0 auto; order: -1; font-size: 16px; }
    .page .table td.tc-rank::before { display: none; }
    .page .table td.tc-rank + td.tc-name { flex: 1 1 auto; }
    /* Действия — отдельной строкой снизу. */
    .page .table td.actions { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
    .page .table td.actions::before { display: none; }
    .actions { text-align: left; }
    .actions > * + * { margin-left: 0; }
    .table .actions .btn-mini.danger { min-height: 38px; padding: 8px 10px; }

    /* Поля ввода — 16px на мобиле, иначе iOS Safari зумит при фокусе и не отъезжает обратно. */
    .field input, .field input[type=text], .field input[type=password] { font-size: 16px; }

    /* Тулбар фильтров (Проверка работ): селекты в столбик на всю ширину, иначе выпирают за экран. */
    .toolbar { flex-wrap: wrap; gap: 8px; }
    .toolbar .filter-select, .filter-select { flex: 1 1 100%; min-width: 0; width: 100%; }
    .toolbar .spacer { display: none; }
}

/* ─── Sidebar: подпункты (визуальная иерархия) ─── */
.nav-item.nav-sub { padding-left: 32px; font-size: 14px; }
.nav-item.nav-sub .ico { font-size: 13px; }

/* ─── Dashboard (ЛК ученика — главная /admin/student/) ─── */

.dash-hello { margin-bottom: 28px; }
.dash-hello h1 { margin: 0 0 6px; font-size: 26px; font-weight: 700; }
.dash-hello-sub { font-size: 14px; color: var(--text-dim); }
.dash-hello + .group-tabs { margin-top: 4px; }

.dash-section { margin-bottom: 32px; }
.dash-section-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    margin: 0 0 20px;
}
.dash-section-head h2 { margin: 0; }

.dash-link {
    font-size: 13px; color: var(--text-dim); text-decoration: none;
    border-bottom: 1px dashed transparent; padding-bottom: 1px;
    transition: color 120ms, border-color 120ms;
}
.dash-link:hover { color: var(--violet-bright); border-bottom-color: var(--violet-bright); }

.dash-empty {
    background: var(--surface); border: 1px dashed var(--border); border-radius: 12px;
    padding: 22px 24px; display: flex; align-items: center; gap: 14px;
    color: var(--text-dim); font-size: 14.5px;
}
.dash-empty-ico { font-size: 32px; line-height: 1; flex-shrink: 0; }

@media (max-width: 700px) {
    .dash-hello h1 { font-size: 22px; }
    .dash-section-head { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* ─── Homework page (ЛК ученика, /admin/student/homework/) ─── */

.hw-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
    margin: 0 0 28px;
}
.hw-stat {
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    padding: 14px 16px; text-align: left;
}
.hw-stat-num { font-size: 28px; font-weight: 700; line-height: 1; color: var(--text); }
.hw-stat-lbl { font-size: 12px; color: var(--text-dim); margin-top: 6px; text-transform: lowercase; letter-spacing: 0.3px; }
.hw-stat.done .hw-stat-num     { color: var(--success); }
.hw-stat.not-done .hw-stat-num { color: var(--error); }
.hw-stat.pending .hw-stat-num  { color: var(--violet-bright); }

.hw-empty {
    background: var(--surface); border: 1px dashed var(--border); border-radius: 14px;
    padding: 48px 24px; text-align: center;
}
.hw-empty-ico { font-size: 48px; margin-bottom: 12px; }
.hw-empty-title { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.hw-empty-sub { font-size: 14px; color: var(--text-dim); }

.hw-list { display: flex; flex-direction: column; gap: 16px; }

.hw-card {
    display: grid; grid-template-columns: 96px 1fr; gap: 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; overflow: hidden;
    transition: transform 120ms ease, border-color 120ms;
}
.hw-card:hover { border-color: var(--violet); }
.hw-card.is-latest {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.12), 0 1px 2px rgba(0,0,0,0.2);
}

.hw-date {
    background: linear-gradient(180deg, var(--surface-2) 0%, var(--bg-side) 100%);
    border-right: 1px solid var(--border);
    padding: 18px 12px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
}
.hw-date-day {
    font-size: 36px; font-weight: 700; line-height: 1;
    color: var(--text); font-family: 'Inter', sans-serif; font-variant-numeric: tabular-nums;
}
.hw-date-month {
    font-size: 13px; color: var(--text-dim);
    margin-top: 4px; letter-spacing: 0.3px;
}
.hw-date-wd {
    font-size: 11px; color: var(--muted, var(--text-dim));
    margin-top: 8px; text-transform: uppercase; letter-spacing: 1px; opacity: 0.7;
}

.hw-card.status-done .hw-date     { background: linear-gradient(180deg, rgba(74,222,128,0.10), rgba(74,222,128,0.04)); }
.hw-card.status-not_done .hw-date { background: linear-gradient(180deg, rgba(248,113,113,0.10), rgba(248,113,113,0.04)); }

/* ===== Рекорды игр: шапка с кнопкой перезапуска + история раундов (страница учителя) ===== */
.games-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; margin-bottom: 16px; }
.games-hd h2 { margin: 0; }
.games-hd-sub { font-weight: 400; font-size: 13px; color: var(--muted); }
/* Перезапуск — спрятан под раскрывашку + чекбокс (защита от случайного нажатия) */
.restart-wrap { font-size: 13px; }
.restart-summary { cursor: pointer; color: var(--muted); list-style: none; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; user-select: none; }
.restart-summary::-webkit-details-marker { display: none; }
.restart-wrap[open] .restart-summary { color: var(--text); }
.restart-box { margin-top: 10px; max-width: 340px; padding: 12px; border: 1px solid rgba(248,113,113,0.25); border-radius: 8px; background: rgba(248,113,113,0.04); }
.restart-note { margin: 0 0 10px; font-size: 12.5px; color: var(--text-dim); line-height: 1.4; }
.restart-ack { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-dim); margin-bottom: 10px; cursor: pointer; }
.restart-ack input { cursor: pointer; }
#restart-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.round-hist { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: var(--surface); }
.round-hist-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.round-hist-head .when { font-size: 12px; color: var(--muted); }
.round-hist-label { font-size: 12px; color: var(--violet-bright); }
.round-hist-empty { font-size: 13px; color: var(--muted); }
.round-hist-top { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.round-hist-top li { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.round-hist-top .rh-nm { color: var(--text-dim); }
.round-hist-top strong { color: var(--text); font-variant-numeric: tabular-nums; }

/* История раундов в оверлее лидерборда (кабинет ученика) */
.lb-history { margin-top: 14px; text-align: left; }
.lb-hist-round { margin-bottom: 10px; }
.lb-hist-when { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.lb-hist-top { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.lb-hist-top li { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 2px 6px; border-radius: 5px; }
.lb-hist-top strong { font-variant-numeric: tabular-nums; }
.lb-hist-top li.is-me { background: rgba(139,92,246,0.16); color: var(--violet-bright); font-weight: 700; }
.lb-hist-top li.is-me strong { color: var(--violet-bright); }
.lb-hist-empty, .lb-hist-none { font-size: 12.5px; color: var(--muted); }
/* Список «ребята из твоих групп» (одногруппники + сам ученик, подсвечен) в прошлом раунде */
.lb-hist-peers-t { margin-top: 8px; font-size: 10.5px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); }
.lb-hist-peers { list-style: none; margin: 3px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.lb-hist-peers li { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--text-dim); padding: 2px 6px; border-radius: 5px; }
.lb-hist-peers strong { font-variant-numeric: tabular-nums; }
.lb-hist-peers li.is-me { background: rgba(139,92,246,0.16); color: var(--violet-bright); font-weight: 700; }
.lb-hist-peers li.is-me strong { color: var(--violet-bright); }

/* «Моё место» в лидерборде — среди своих и в общем зачёте */
.lb-myrank { margin-top: 10px; text-align: center; font-size: 13px; color: var(--text-dim); padding: 8px 10px; background: rgba(139,92,246,0.06); border: 1px solid rgba(139,92,246,0.18); border-radius: 8px; }
.lb-myrank b { color: var(--violet-bright); font-variant-numeric: tabular-nums; }
.lb-myrank .sep { margin: 0 8px; opacity: 0.45; }

/* Строка игрока-учителя в лидерборде (вне детского зачёта) */
.lb-staff { margin-top: 12px; }
.lb-staff-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid rgba(139,92,246,0.3); border-radius: 8px; background: rgba(139,92,246,0.08); font-size: 14px; }
.lb-staff-row .nm { font-weight: 600; color: var(--violet-bright); }
.lb-staff-row .sc { font-weight: 700; font-variant-numeric: tabular-nums; }
/* Строка учителя на странице «Рекорды игр» */
.staff-rec { display: flex; align-items: center; gap: 12px; margin: 8px 0 4px; padding: 10px 14px; border: 1px solid rgba(139,92,246,0.3); border-radius: 8px; background: rgba(139,92,246,0.06); }
.staff-rec .sr-nm { font-weight: 600; color: var(--violet-bright); }
.staff-rec .sr-sc { font-weight: 700; font-variant-numeric: tabular-nums; }
.staff-rec form { margin-left: auto; }

/* Просроченная на проверку домашка (срок сдачи прошёл, выполненность не отмечена):
   янтарный приглушённый «корешок» даты, рамка обычная — НЕ красная, чтобы не сливалась
   со статусом «не сделано» (правка пользователя 12.06). Рамка .is-latest остаётся
   только у актуальной домашки (срок сдачи ещё не пришёл) — решает PHP страницы. */
.hw-card.hw-overdue .hw-date {
    background: linear-gradient(180deg, rgba(251,191,36,0.12), rgba(251,191,36,0.04));
    opacity: 0.6;
}

.hw-content { padding: 18px 22px; }
.hw-head {
    display: flex; align-items: flex-start; gap: 12px; justify-content: space-between;
    margin-bottom: 10px;
}
.hw-topic {
    font-size: 16px; font-weight: 600; color: var(--text); margin: 0; line-height: 1.4;
}
.hw-topic.muted { color: var(--text-dim); font-weight: 500; }

.hw-badge {
    flex-shrink: 0; font-size: 12.5px; color: var(--text-dim);
    background: var(--surface-2); padding: 4px 10px; border-radius: 999px;
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.hw-badge .dot { font-size: 14px; line-height: 1; }
.dot-done { color: var(--success); }
.dot-not_done { color: var(--error); }
.dot-pending { color: var(--violet-bright); }
.status-done .hw-badge     { color: var(--success); background: rgba(74,222,128,0.10); }
.status-not_done .hw-badge { color: var(--error);   background: rgba(248,113,113,0.10); }

.hw-latest-label {
    display: inline-block; font-size: 11.5px; color: var(--violet-bright); font-weight: 600;
    background: rgba(139,92,246,0.12); border: 1px solid rgba(139,92,246,0.25);
    padding: 3px 10px; border-radius: 999px;
    margin-bottom: 10px; letter-spacing: 0.2px;
}

.hw-body {
    font-size: 15px; line-height: 1.65; color: var(--text);
}
.hw-body code {
    background: var(--surface-2); padding: 1px 6px; border-radius: 4px;
    font-size: 13.5px; font-family: 'JetBrains Mono', Consolas, monospace; color: var(--violet-bright);
}
.hw-body p { margin: 0 0 10px; }
.hw-body p:last-child { margin-bottom: 0; }
.hw-body strong { color: var(--text); font-weight: 600; }
/* Широкий код в тексте домашки (сырой HTML работника) — скроллится внутри, не выпирает за карточку. */
.hw-body pre { overflow-x: auto; max-width: 100%; }
.hw-body code, .thw-hw-meta code, p code { overflow-wrap: anywhere; }

.hw-foot {
    margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-soft);
    display: flex; gap: 12px; align-items: center; font-size: 13px; color: var(--text-dim);
}
.hw-points { color: var(--violet-bright); font-weight: 500; }

@media (max-width: 700px) {
    .hw-stats { grid-template-columns: repeat(2, 1fr); }
    .hw-card { grid-template-columns: 72px 1fr; }
    .hw-date { padding: 14px 8px; }
    .hw-date-day { font-size: 28px; }
    .hw-date-month { font-size: 12px; }
    .hw-content { padding: 14px 16px; }
    .hw-head { flex-direction: column; gap: 6px; }
    .hw-badge { align-self: flex-start; }
}

/* ─── Toast (PRG-flash, появляется справа сверху, auto-dismiss) ─── */
.toast-stack {
    position: fixed; top: 20px; right: 20px; z-index: 10000;
    display: flex; flex-direction: column; gap: 10px;
    max-width: 380px; pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; border-radius: 10px;
    background: var(--surface-2, #1F1438);
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.25);
    color: var(--text); font-size: 14px; line-height: 1.45;
    animation: toast-in 220ms cubic-bezier(.2,.7,.3,1) both;
}
.toast.dismissing { animation: toast-out 200ms ease-in both; }
.toast .toast-ico { font-size: 16px; line-height: 1.4; flex-shrink: 0; }
.toast .toast-msg { flex: 1; word-break: break-word; }
.toast .toast-close {
    flex-shrink: 0; background: none; border: 0; color: var(--text-dim); cursor: pointer;
    font-size: 16px; line-height: 1; padding: 2px 4px; margin: -2px -4px -2px 0; border-radius: 4px;
}
.toast .toast-close:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.toast.success { background: var(--success-bg); border-color: rgba(74,222,128,0.3); }
.toast.success .toast-ico { color: var(--success); }
.toast.error   { background: var(--error-bg);   border-color: rgba(248,113,113,0.35); }
.toast.error .toast-ico   { color: var(--error); }
.toast.info    { background: var(--info-bg);    border-color: rgba(96,165,250,0.3); }
.toast.info .toast-ico    { color: var(--info); }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(24px); }
}

/* ─── Modal confirm (overlay + dialog в центре) ─── */
.modal-overlay {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(0,0,0,0.55); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; animation: overlay-in 160ms ease-out both;
}
.modal-overlay.dismissing { animation: overlay-out 140ms ease-in both; }
.modal-dialog {
    background: var(--surface-2, #1F1438);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.35);
    padding: 22px 24px 18px;
    max-width: 460px; width: 100%;
    animation: dialog-in 220ms cubic-bezier(.2,.7,.3,1) both;
}
.modal-overlay.dismissing .modal-dialog { animation: dialog-out 160ms ease-in both; }
.modal-title { font-size: 17px; font-weight: 600; color: var(--text); margin: 0 0 8px; }
.modal-body  { font-size: 14.5px; color: var(--text-dim); line-height: 1.5; margin: 0 0 18px; white-space: pre-wrap; }
.modal-buttons { display: flex; gap: 10px; justify-content: flex-end; }
.modal-btn {
    padding: 8px 16px; border-radius: 8px; border: 1px solid rgba(194,184,222,0.25);
    background: transparent; color: var(--text-dim); font-size: 14px;
    font-family: inherit; cursor: pointer; transition: background 120ms, color 120ms, border-color 120ms;
}
.modal-btn:hover { background: rgba(255,255,255,0.06); color: var(--text); border-color: var(--violet); }
.modal-btn.primary { background: var(--violet, #8B5CF6); color: #fff; border-color: transparent; }
.modal-btn.primary:hover { background: var(--violet-hover, #7C3AED); color: #fff; }
.modal-btn.danger { background: var(--error-bg); color: var(--error); border-color: rgba(248,113,113,0.35); }
.modal-btn.danger:hover { background: rgba(248,113,113,0.18); color: var(--error); border-color: var(--error); }

@keyframes overlay-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes overlay-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes dialog-in   { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
@keyframes dialog-out  { from { opacity: 1; transform: scale(1); }    to { opacity: 0; transform: scale(.96); } }

/* ─── Praise popover (похвала-«печенька» при наведении на карточку ученика) ─── */
.praise-pop {
    position: fixed; z-index: 10001;
    max-width: 250px; padding: 12px 15px;
    background: linear-gradient(135deg, var(--surface-2) 0%, var(--bg-side) 100%);
    border: 1px solid rgba(139, 92, 246, 0.45);
    border-radius: 14px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), 0 0 22px rgba(139, 92, 246, 0.12);
    color: var(--text); font-size: 13.5px; line-height: 1.5; font-weight: 500;
    opacity: 0; visibility: hidden;
    transform: translateY(6px) scale(0.96);
    transition: opacity 180ms ease, transform 200ms cubic-bezier(.2, .7, .3, 1), visibility 200ms;
    pointer-events: none;
}
.praise-pop.show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

@media (max-width: 700px) {
    .toast-stack { left: 12px; right: 12px; top: 12px; max-width: none; }
    .modal-dialog { padding: 18px 18px 14px; border-radius: 12px; }
}

/* ─── Домашки учителя (/admin/staff/homework/) ─── */
.thw-day {
    margin: 30px 0 14px; display: flex; align-items: baseline; gap: 10px;
    padding-bottom: 8px; border-bottom: 1px solid var(--border-soft, var(--border));
}
.thw-day h2 { margin: 0; font-size: 18px; }
.thw-day.today h2 { color: var(--violet-bright); }
.thw-day-date { color: var(--muted); font-size: 13px; }

.thw-list { display: grid; gap: 12px; }
.thw-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; padding: 0; overflow: hidden;
}
.thw-card-head {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.015);
    border-bottom: 1px solid var(--border-soft, var(--border));
}
.thw-card-head h3 { margin: 0; font-size: 16px; }
.thw-time {
    color: var(--text-dim); font-size: 12px;
    background: var(--surface-2); padding: 2px 9px; border-radius: 999px;
}
.thw-links { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.thw-hw { padding: 14px 18px 16px; }
.thw-hw-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.thw-hw-topic { font-weight: 600; color: var(--text); }
/* Текст домашки — панель с фиолетовым акцентом слева: главный визуальный якорь карточки. */
.thw-card .hw-body {
    background: rgba(139, 92, 246, 0.05);
    border-left: 3px solid rgba(139, 92, 246, 0.45);
    border-radius: 0 10px 10px 0;
    padding: 10px 14px;
}
.thw-none { color: var(--muted); font-size: 14px; padding: 14px 18px; }
.thw-hw + .thw-none, .thw-hw .thw-none { padding-top: 0; }

.thw-filterbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
    margin: 18px 0 4px; padding: 10px 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border-soft, var(--border));
}
.thw-days { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.thw-day-chip {
    position: relative;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 11px; border-radius: 999px;
    border: 1px solid var(--border); background: transparent;
    color: var(--text-dim); font: inherit; font-size: 13px;
    text-decoration: none; cursor: pointer;
}
.thw-day-chip:hover { border-color: var(--violet); color: var(--text); }
.thw-day-chip.is-active {
    background: rgba(139,92,246,0.18); border-color: var(--violet);
    color: var(--violet-bright);
}
/* Маркер «сегодня»: кольцо-ободок снаружи (box-shadow не влияет на размеры и layout),
   видно всегда — и при выбранном, и при невыбранном дне. Лента не прыгает. */
.thw-day-chip.is-today {
    border-color: rgba(139, 92, 246, 0.55);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.22);
}
.thw-day-chip .n { font-size: 11px; color: var(--muted); }
.thw-day-chip.is-active .n { color: var(--violet-bright); }
.thw-cal-input {
    position: absolute; right: 0; bottom: 0; width: 1px; height: 1px;
    opacity: 0; pointer-events: none; color-scheme: dark;
}
.thw-filter-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.thw-toggle {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; color: var(--text-dim); cursor: pointer; user-select: none;
}
.thw-toggle input { accent-color: var(--violet, #8B5CF6); }
.thw-reset { margin-left: auto; }
.thw-wait-num { color: var(--warning); }

.thw-chips {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 12px 18px;
    border-top: 1px solid var(--border-soft, var(--border));
}

/* ─── Форма правки домашки (/admin/staff/homework/edit.php) ─── */
.hwedit-label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.hwedit-textarea {
    width: 100%; box-sizing: border-box;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: 10px;
    padding: 12px 14px; font-size: 14px; line-height: 1.6;
    font-family: 'JetBrains Mono', Consolas, monospace;
    resize: vertical;
}
.hwedit-textarea:focus { outline: none; border-color: var(--violet); }
.hwedit-actions { margin-top: 12px; display: flex; gap: 10px; align-items: center; }
.hwedit-h2 { margin: 28px 0 12px; font-size: 18px; }
.hwedit-images { display: flex; flex-wrap: wrap; gap: 14px; }
.hwedit-img {
    display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px;
}
.hwedit-img img { max-width: 220px; max-height: 150px; border-radius: 8px; display: block; }
.hwedit-add { margin-top: 22px; }
.hwedit-delzone {
    margin-top: 22px; padding-top: 14px;
    border-top: 1px solid var(--border-soft, var(--border));
    display: flex; gap: 10px; align-items: center;
}
/* Дроп-зона скринов: перетащи или кликни, заливка идёт сама. */
.hwedit-drop {
    margin-top: 16px; padding: 22px 18px;
    border: 2px dashed var(--border); border-radius: 12px;
    text-align: center; color: var(--text-dim); font-size: 14px;
    cursor: pointer; transition: border-color 140ms, background 140ms;
}
.hwedit-drop:hover { border-color: var(--violet); }
.hwedit-drop.over {
    border-color: var(--violet); background: rgba(139, 92, 246, 0.08);
    color: var(--text);
}
.hwedit-drop.busy { cursor: progress; border-style: solid; border-color: var(--violet); }
.hwedit-drop input[type=file] { display: none; }
.hwedit-drop-label .meta { display: inline-block; margin-top: 6px; }

/* ─── Редактор ответа внешнего учителя (/admin/teacher/review.php) ─── */
.ted-tabs { display: flex; gap: 6px; margin-bottom: 0; }
.ted-tab {
    padding: 6px 16px; border-radius: 8px 8px 0 0;
    background: transparent; border: 1px solid var(--border); border-bottom: none;
    color: var(--text-dim); font: inherit; font-size: 13px; cursor: pointer;
}
.ted-tab.active { background: var(--surface); color: var(--text); font-weight: 600; }
.ted-toolbar {
    display: flex; flex-wrap: wrap; gap: 6px; padding: 8px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px 10px 0 0; border-bottom: 1px solid var(--border-soft, var(--border));
}
.ted-toolbar button {
    padding: 4px 10px; border-radius: 6px;
    background: transparent; border: 1px solid var(--border);
    color: var(--text-dim); font: inherit; font-size: 13px; cursor: pointer;
}
.ted-toolbar button:hover { border-color: var(--violet); color: var(--text); }
.ted-rich {
    min-height: 260px; padding: 14px 16px;
    background: var(--surface); border: 1px solid var(--border); border-top: none;
    border-radius: 0 0 10px 10px;
    font-size: 15px; line-height: 1.65; color: var(--text);
    outline: none; overflow-y: auto; max-height: 60vh;
}
.ted-rich:focus { border-color: var(--violet); }
.ted-rich code { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; color: var(--violet-bright); }
#ted-html { min-height: 260px; border-radius: 0 0 10px 10px; }

/* ─── Лайтбокс картинок домашки ─── */
.hw-lightbox {
    position: fixed; inset: 0; z-index: 10010;
    display: none; align-items: center; justify-content: center;
    background: rgba(10, 5, 25, 0.88);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.hw-lightbox.open { display: flex; }
body.hwlb-lock { overflow: hidden; }
.hwlb-img {
    max-width: calc(100vw - 110px); max-height: calc(100vh - 60px);
    border-radius: 10px; border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.hwlb-close {
    position: absolute; top: 14px; right: 16px;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border);
    color: var(--text); font-size: 17px; line-height: 1; cursor: pointer;
}
.hwlb-close:hover { background: rgba(248, 113, 113, 0.2); border-color: var(--error); }
.hwlb-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 44px; height: 64px; border-radius: 10px;
    background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border);
    color: var(--text); font-size: 30px; line-height: 1; cursor: pointer;
}
.hwlb-nav:hover { background: rgba(139, 92, 246, 0.25); border-color: var(--violet); }
.hwlb-prev { left: 12px; }
.hwlb-next { right: 12px; }
.hwlb-caption {
    position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
    color: var(--text-dim); font-size: 13px;
    background: rgba(255, 255, 255, 0.06); padding: 3px 12px; border-radius: 999px;
}
@media (max-width: 700px) {
    .hwlb-img { max-width: calc(100vw - 16px); max-height: calc(100vh - 120px); }
    .hwlb-nav { top: auto; bottom: 48px; transform: none; }
    .hwlb-prev { left: 18%; }
    .hwlb-next { right: 18%; }
}

/* Файлы-вложения к домашке (стартовые .blend-сцены, архивы, инструкции) */
.hw-attfiles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hw-file-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 10px;
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text); font-size: 13.5px; text-decoration: none;
}
.hw-file-link:hover { border-color: var(--violet); color: var(--violet-bright); }

/* Плюс на кнопках добавления — свой цвет, не сливается с фоном primary-кнопки */
.btn-plus { font-weight: 800; color: #4ade80; margin-right: 2px; }

/* Форма «создать домашку» (учитель/админ) */
.thw-create-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 14px; }
.thw-create-row label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-dim); }

/* Картинки к домашке (общее: ЛК ученика + страница учителя) */
.hw-images { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.hw-images a { display: block; line-height: 0; }
.hw-images img {
    max-width: 280px; max-height: 200px;
    border-radius: 10px; border: 1px solid var(--border);
    transition: border-color 120ms;
}
.hw-images a:hover img { border-color: var(--violet); }
/* На дашборде ученика (свежая домашка) — минимальные превью (просьба пользователя 11.06);
   полный размер — по клику через лайтбокс. Крупные превью — на странице «Домашка». */
.dash-section .hw-images img { max-width: 132px; max-height: 88px; border-radius: 8px; }
@media (max-width: 700px) {
    .hw-images img { max-width: 100%; }
    .dash-section .hw-images img { max-width: 110px; }
}
.thw-chip {
    font-size: 12.5px; padding: 3px 10px; border-radius: 999px;
    border: 1px solid var(--border); color: var(--text-dim);
}
.thw-chip.done     { background: rgba(74,222,128,0.10);  color: var(--success); border-color: rgba(74,222,128,0.25); }
.thw-chip.not_done { background: rgba(248,113,113,0.10); color: var(--error);   border-color: rgba(248,113,113,0.25); }

/* Чипы-кнопки (клик переключает статус: ⏳ → ✅ → ❌ → ⏳, страница «Домашки») */
button.thw-chip { background: none; cursor: pointer; font-family: inherit; transition: transform 80ms ease, border-color 120ms; }
button.thw-chip:hover { border-color: var(--violet); transform: scale(1.04); }
button.thw-chip:disabled { opacity: 0.5; cursor: wait; }

@media (max-width: 700px) {
    .thw-links { margin-left: 0; width: 100%; }
    /* Тач-цели: чипы статусов ДЗ (кликабельны, мутируют статус) и кнопки редактора крупнее на телефоне. */
    .thw-chips { gap: 8px; }
    button.thw-chip { padding: 8px 12px; font-size: 13px; }
    .ted-toolbar button { padding: 8px 12px; }
}

/* Ячейка-превью текста ДЗ в таблице учителя: на десктопе одна строка с многоточием,
   в мобильном карточном режиме — разворачивается целиком (класс вместо инлайн-стиля). */
.thw-prev-cell { max-width: 380px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 920px) {
    .thw-prev-cell { max-width: none; white-space: normal; overflow: visible; text-overflow: clip; }
}
