/* Стили портала поверх styles.css / mysolver.css */

/* Атрибут hidden должен побеждать любые display у классов (.pt-login, .shell). */
[hidden] { display: none !important; }

/* ---- Экран входа ---- */
.pt-login { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg-0, #060606); z-index: 50; }
.pt-login-card { width: 340px; padding: 28px 26px; display: grid; gap: 14px; }
.pt-login-card .brand-word.big { font-size: 28px; text-align: center; }
.pt-login-sub { text-align: center; color: var(--muted, #8b8b8b); font-size: 12.5px; margin-bottom: 6px; }
.pt-login-card form { display: grid; gap: 12px; }
.pt-login-err { color: #ffb2b2; font-size: 12.5px; text-align: center; }

/* ---- Сайдбар ---- */
.pt-user-cell { min-width: 0; flex: 1; }
.pt-logout { border: 0; background: transparent; color: var(--fg-3, #8b8b8b); cursor: pointer; font-size: 15px; padding: 4px 6px; border-radius: 6px; }
.pt-logout:hover { color: #ffb2b2; background: rgba(255,255,255,.05); }

/* ---- Главная: коллекции ---- */
.pt-home-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; }
.pt-home-head h2 { margin: 4px 0 2px; }
.pt-empty { color: var(--muted, #8b8b8b); padding: 40px; text-align: center; }
.pt-collections { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.pt-col-card { border: 1px solid var(--line, #222); border-radius: 18px; padding: 16px; background: linear-gradient(180deg, rgba(15,27,32,.78), rgba(8,14,17,.76)); display: grid; gap: 10px; align-content: start; }
.pt-col-card h3 { margin: 0; font-size: 15.5px; font-weight: 600; letter-spacing: -.02em; }
.pt-col-note { color: var(--muted, #8b8b8b); font-size: 12.5px; line-height: 1.4; min-height: 17px; }
.pt-col-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted2, #6f6f6f); font-size: 11.5px; }
.pt-col-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pt-status { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 600; letter-spacing: .03em; }
.pt-status.assigned    { background: rgba(86,215,253,.12); color: #7fd9f5; }
.pt-status.in_progress { background: rgba(212,162,75,.14); color: #e5b566; }
.pt-status.submitted   { background: rgba(42,108,74,.25); color: #79d9a8; }
.pt-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line, #2a2a2a); border-radius: 999px; padding: 4px 10px; font-size: 11.5px; cursor: pointer; background: rgba(3,3,3,.3); color: var(--text2, #cfcfcf); transition: .15s ease; }
.pt-chip:hover { border-color: var(--accent, #56d7fd); }
.pt-chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.pt-chip .dot.assigned { background: #7fd9f5; }
.pt-chip .dot.in_progress { background: #e5b566; }
.pt-chip .dot.submitted { background: #79d9a8; }
.pt-assign-box { border-top: 1px solid var(--line, #222); padding-top: 10px; display: none; gap: 6px; }
.pt-assign-box.open { display: grid; }
.pt-assign-box label.pt-assign-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text2, #cfcfcf); cursor: pointer; }
.pt-assign-box input[type="checkbox"] { width: auto; }

/* Задание тренера на карточке коллекции. */
.pt-task { border: 1px solid rgba(86,215,253,.25); background: rgba(86,215,253,.07); border-radius: 12px; padding: 8px 10px; font-size: 12.5px; line-height: 1.45; color: var(--text2, #d5d5d5); white-space: pre-wrap; word-break: break-word; }
.pt-task b { color: #7fd9f5; }

/* Редактор карточки (название/описание/задание) — скрыт до клика. */
.pt-edit-box { border-top: 1px solid var(--line, #222); padding-top: 10px; display: none; gap: 8px; }
.pt-edit-box.open { display: grid; }
.pt-edit-box label { display: grid; gap: 4px; font-size: 11.5px; color: var(--muted, #8b8b8b); }

/* Строка ученика на тренерской карточке: чип статуса + сводка прогресса. */
.pt-assign-rows { display: grid; gap: 6px; }
.pt-assign-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pt-progress { font-size: 11.5px; color: var(--muted, #9b9b9b); white-space: nowrap; }

/* ---- Реплеер: баннер ревью и комментарии ---- */
.pt-review-banner { margin: 8px 12px 0; border: 1px solid rgba(212,162,75,.4); background: rgba(212,162,75,.10); color: #e5b566; border-radius: 12px; padding: 8px 10px; font-size: 12px; line-height: 1.35; }
.pt-comments { display: grid; gap: 6px; max-height: 180px; overflow: auto; padding: 8px 12px 0; }
.pt-comment { border: 1px solid var(--line, #222); background: rgba(3,3,3,.3); border-radius: 12px; padding: 7px 9px; font-size: 12.5px; line-height: 1.4; color: var(--text2, #d5d5d5); white-space: pre-wrap; word-break: break-word; }
.pt-comment .pt-comment-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 3px; font-size: 10.5px; color: var(--muted2, #6f6f6f); }
.pt-comment .pt-comment-author { font-weight: 700; color: var(--accent, #56d7fd); }
.pt-comment.teacher .pt-comment-author { color: #e5b566; }
.pt-comment-form { display: flex; gap: 8px; padding: 8px 12px 12px; align-items: flex-end; }
.pt-comment-form textarea { flex: 1; }
.pt-comment-send { flex-shrink: 0; padding: 9px 12px; }

/* ---- Админка ---- */
.pt-admin-grid { display: grid; grid-template-columns: 380px 1fr; gap: 16px; align-items: start; }
.pt-admin-grid .card { padding: 18px; display: grid; gap: 12px; }
.pt-admin-grid h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.pt-students-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pt-students-table th { text-align: left; color: var(--muted, #8b8b8b); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 6px 8px; border-bottom: 1px solid var(--line, #222); }
.pt-students-table td { padding: 8px; border-bottom: 1px solid rgba(255,255,255,.04); }
.pt-token-box { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: rgba(3,3,3,.5); border: 1px solid var(--line, #222); border-radius: 10px; padding: 9px 11px; word-break: break-all; color: #9ff7d3; }
.pt-cmd { font-family: ui-monospace, Consolas, monospace; font-size: 11px; background: rgba(3,3,3,.5); border: 1px solid var(--line, #222); border-radius: 10px; padding: 9px 11px; color: var(--text2, #cfcfcf); white-space: pre-wrap; word-break: break-all; line-height: 1.5; }
.pt-inactive { opacity: .45; }

/* Колонка алиасов в таблице учеников: не даём длинным спискам ников распирать таблицу. */
.pt-students-table td.pt-nicks { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Аналитика ---- */
.an-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.an-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border, #223); border-radius: 999px; padding: 7px 14px; font-size: 12.5px; cursor: pointer; background: var(--bg-2, rgba(3,3,3,.3)); color: var(--fg-1, #cfcfcf); text-decoration: none; transition: .15s ease; }
.an-chip:hover { border-color: var(--gold-400, #d4a24b); color: var(--fg-0, #f5f2ea); }
.an-chip.active { border-color: var(--gold-400, #d4a24b); background: rgba(212,162,75,.12); color: var(--gold-400, #e5b566); font-weight: 600; }
.an-card { padding: 14px 16px; display: grid; gap: 12px; }
.an-toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.an-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.an-tab { border: 1px solid var(--border, #223); background: transparent; color: var(--fg-2, #9b9b9b); border-radius: 8px; padding: 6px 11px; font-size: 12px; cursor: pointer; transition: .15s ease; }
.an-tab:hover { color: var(--fg-0, #f5f2ea); border-color: var(--border-strong, #345); }
.an-tab.active { background: var(--bg-3, #182320); color: var(--gold-400, #e5b566); border-color: var(--gold-400, #d4a24b); font-weight: 600; }
#anSearch { max-width: 240px; }
.an-section { margin: 10px 0 6px; font-size: 13px; font-weight: 700; color: var(--gold-400, #e5b566); letter-spacing: .02em; }
.an-tablewrap { overflow-x: auto; border: 1px solid var(--border, #223); border-radius: 12px; }
.an-table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.an-table th { position: sticky; top: 0; text-align: left; background: var(--bg-3, #182320); color: var(--fg-2, #9b9b9b); font-weight: 600; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px; border-bottom: 1px solid var(--border-strong, #345); cursor: pointer; user-select: none; }
.an-table th:hover { color: var(--fg-0, #f5f2ea); }
.an-table th.sorted { color: var(--gold-400, #e5b566); }
.an-table th.sorted[data-dir="asc"]::after { content: " ↑"; }
.an-table th.sorted[data-dir="desc"]::after { content: " ↓"; }
.an-table td { padding: 6px 10px; border-bottom: 1px solid rgba(255,255,255,.045); color: var(--fg-1, #d5d5d5); }
.an-table tbody tr:hover td { background: rgba(255,255,255,.03); }
.an-table th.num, .an-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.an-table td:first-child { color: var(--fg-0, #f0ede5); }

/* Готовый html-отчёт (bvb_actions) — встраивается на всю высоту вкладки. */
.an-html-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.an-frame { width: 100%; height: calc(100vh - 250px); min-height: 480px; border: 1px solid var(--border, #223); border-radius: 12px; background: #060807; }
