/* Оформление повторяет пользовательский портал iSpring (vseoptika.ispring.ru):
   Roboto, текст #42484e, фон #f2f2f3, фирменный салатовый #96db79, белые карточки с тенью. */
/* Палитра, шапка и боковая панель разделов — в shell.css (общие с администрированием). */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/20px Roboto, Tahoma, sans-serif;
}

a { color: var(--link); }
h1 { font-weight: 500; font-size: 28px; line-height: 32px; margin: 0 0 16px; }
h2 { font-weight: 500; font-size: 22px; line-height: 30px; margin: 24px 0 12px; }
.lead, .muted { color: var(--muted); }

.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; }
button.link:hover { color: var(--text); }

/* Баннеры */
.banner {
  position: relative; height: 160px; display: flex; align-items: flex-end;
  background: #3f7d2a url("../img/portal-header.5398a57f3d37.jpg") center / cover no-repeat;
}
/* Затемнение как в iSpring: поверх баннера чёрный слой 50% */
.banner::before { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); }
.banner > * { position: relative; }
.hero {
  position: relative; min-height: 260px; padding: 16px 30px 40px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: #2f5a20 url("../img/portal-header.5398a57f3d37.jpg") center / cover no-repeat;
  color: #fff;
}
.hero::before { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); }
.hero > * { position: relative; }
.hero a.back { color: #fff; text-decoration: none; font-size: 13px; }
.hero a.back:hover { text-decoration: underline; }
.hero .kind { font-size: 13px; margin-bottom: 16px; }
.hero h1, .banner h1 { color: #fff; font-size: 36px; line-height: 44px; margin: 0; }
.hero .progress-text { margin-top: 16px; }
.hero .bar { background: rgba(255, 255, 255, 0.3); max-width: 480px; }
.status-pill {
  display: inline-block; margin-top: 16px; padding: 8px 12px; border-radius: 20px;
  background: rgba(255, 255, 255, 0.16); color: #fff;
}
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 30px; }
.banner .wrap { width: 100%; padding-bottom: 46px; }

/* Страница */
.page { max-width: 1200px; margin: 0 auto; padding: 24px 30px 60px; }
.page-narrow { max-width: 860px; }
/* Отчёты: широкие таблицы — на всю ширину окна, а не 1200 px (25.11.2026) */
.page.page-wide { max-width: none; }
.panel { background: var(--surface); border-radius: 6px; box-shadow: var(--shadow); padding: 28px; margin-bottom: 16px; }
.toolbar { background: var(--surface); }
.toolbar .wrap { display: flex; align-items: center; gap: 16px; padding-top: 16px; padding-bottom: 16px; }

/* Вкладки-«таблетки» */
.tabs { display: flex; gap: 0; overflow-x: auto; margin: 0; }
.tabs a {
  display: inline-flex; align-items: center; height: 36px; padding: 0 20px; border-radius: 18px;
  color: var(--muted); text-decoration: none; white-space: nowrap;
}
.tabs a:hover { color: var(--text); }
.tabs a.on { background: var(--pill); color: var(--text); font-weight: 500; }
.page > .tabs { margin-bottom: 16px; }

.toolbar .tabs { flex: 1; min-width: 0; }

/* Поиск, как в iSpring: поле справа от вкладок */
.search { flex: none; width: 260px; }
.search input {
  height: 36px; padding: 0 14px 0 36px; border-radius: 18px; border-color: var(--pill); background: var(--pill)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%238d98a2' d='M10 2a8 8 0 0 1 6.32 12.9l5.39 5.4-1.42 1.4-5.39-5.38A8 8 0 1 1 10 2Zm0 2a6 6 0 1 0 0 12 6 6 0 0 0 0-12Z'/%3E%3C/svg%3E") 13px center no-repeat;
}
.search input:focus { background-color: #fff; }

/* Уведомления */
.notice .notice-dot { flex: none; width: 10px; height: 10px; margin: 0 9px; border-radius: 50%; }
.notice.unread .notice-dot { background: var(--accent); }
.notice:not(.unread) .item-title { font-weight: 400; }
.pager { display: flex; gap: 16px; justify-content: center; margin-top: 16px; }

/* Кнопки и формы */
.btn {
  display: inline-block; padding: 9px 20px; border: 0; border-radius: 4px;
  background: var(--accent); color: #fff; font: 500 15px/20px Roboto, Tahoma, sans-serif;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--accent-dark); }
/* Решение 25.11.2026: светлая кнопка на сером фоне сливалась — белая с рамкой */
.btn-light { padding: 8px 19px; border: 1px solid #c9d0d6; background: #fff; color: var(--text); }
.btn-light:hover { border-color: var(--accent-dark); background: var(--accent-soft); }
.stack { display: grid; gap: 12px; }
.stack label { display: grid; gap: 4px; }
input, textarea, select {
  font: inherit; color: var(--text); padding: 8px 12px; width: 100%;
  border: 1px solid var(--line-strong); border-radius: 4px; background: #fff;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
input[type=radio], input[type=checkbox] { width: auto; accent-color: var(--ok); }

.msg { padding: 12px 16px; border-radius: 6px; background: #e7f1fa; margin-bottom: 16px; }
.msg-success { background: #e2f4e9; }
.msg-error { background: #fde7e4; }
.msg-warning { background: #fff3d6; }

/* Карточки «Мои курсы» */
.card {
  display: flex; gap: 28px; align-items: center; padding: 28px; margin-bottom: 16px;
  background: var(--surface); border-radius: 6px; box-shadow: var(--shadow);
  color: var(--text); text-decoration: none;
}
.card:hover { box-shadow: 0 2px 10px rgba(66, 72, 78, 0.2); }
.card-overdue { box-shadow: inset 4px 0 0 var(--bad), var(--shadow); }
.thumb {
  flex: none; width: 224px; height: 126px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  background: #3f7d2a url("../img/portal-header.5398a57f3d37.jpg") center / cover no-repeat;
  color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em;
}
.thumb.has-cover { background-color: var(--pill); }
.card-body { flex: 1; min-width: 0; max-width: 480px; }
.card-title { font-weight: 500; font-size: 22px; line-height: 30px; }
.card-kind { font-size: 14px; color: var(--muted); }
.card-meta { margin-top: 16px; }
.card-meta .bad { font-weight: 500; }
.bar { height: 6px; background: rgba(141, 152, 162, 0.2); border-radius: 9px; overflow: hidden; margin: 8px 0 0; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 9px; }

/* Содержание курса и траектории */
.contents { background: var(--surface); border-radius: 4px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08); }
.item {
  display: flex; align-items: center; gap: 18px; padding: 18px 32px 15px 18px;
  border-bottom: 1px solid #eee; color: var(--text); text-decoration: none;
}
.item:last-child { border-bottom: 0; }
a.item:hover .item-title { color: var(--link); }
.item-icon { flex: none; width: 28px; height: 28px; color: var(--line-strong); }
.item.done .item-icon { color: var(--ok); }
.item.started .item-icon { color: var(--accent); }
.item-main { flex: 1; min-width: 0; }
.item-title { font-weight: 500; font-size: 15px; }
.item-kind { font-size: 14px; color: var(--muted); }
.item-state { flex: none; text-align: right; }
.item.locked { color: var(--muted); }
.track-list .item { background: var(--surface); border-radius: 6px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04); border: 1px solid var(--line); margin-bottom: 16px; padding: 16px; }
.track-stage { margin: 24px 0 8px; font-size: 16px; line-height: 22px; font-weight: 500; color: var(--muted); }
.track-list .item-title { font-size: 18px; line-height: 21px; }
.ok { color: var(--ok); font-weight: 500; }

/* Урок, тест, задание */
.crumb { display: inline-block; margin-bottom: 16px; color: var(--accent-dark); text-decoration: none; font-size: 14px; font-weight: 500; }
.crumb:hover { color: var(--text); text-decoration: underline; }
.question { border: 1px solid var(--line); border-radius: 6px; margin: 0 0 16px; padding: 16px 20px; background: var(--surface); }
.question legend { font-weight: 500; padding: 0 4px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; }
.save-state { font-size: 13px; min-height: 18px; }
.lesson-body { font-size: 16px; line-height: 24px; }
.lesson-body img, .video { max-width: 100%; height: auto; border-radius: 4px; }
.scorm-frame { width: 100%; height: calc(100vh - 160px); border: 0; border-radius: 6px; background: #fff; box-shadow: var(--shadow); }

/* Отчёты */
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: 6px; box-shadow: var(--shadow); }
.report { border-collapse: collapse; width: 100%; font-size: 14px; }
.report th, .report td { padding: 12px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.report th { font-weight: 500; white-space: nowrap; color: var(--muted); }
.report tbody tr:hover { background: #fafafa; }
.report .num { text-align: right; white-space: nowrap; }
/* Заголовки числовых столбцов — в две строки и мельче: таблица салонов помещается на 1280 px с боковым меню (25.11.2026) */
.report thead th { font-size: 13px; }
.report thead th.num { white-space: normal; vertical-align: bottom; }
.bad { color: var(--bad); font-weight: 500; }
.actions { margin: 0 0 16px; }
.small { font-size: 13px; line-height: 18px; }
.report td.now { min-width: 220px; }
/* Сотрудник в отчёте: назначения карточками, программа раскрыта до курсов */
.plan { background: var(--surface); border-radius: 6px; box-shadow: var(--shadow); margin: 0 0 16px; overflow: hidden; }
.plan-head { display: flex; gap: 24px; align-items: flex-start; justify-content: space-between; padding: 20px 24px 12px; }
.plan-head h2 { margin: 2px 0 0; font-size: 20px; line-height: 26px; }
.plan-meta { flex: none; text-align: right; font-size: 14px; line-height: 20px; }
.plan .bar { margin: 0 24px 8px; }
.plan-lines .item { padding: 12px 24px; border-top: 1px solid #eee; border-bottom: 0; }
.plan-lines .item-title { font-weight: 400; }
.plan-lines .item-state { font-size: 14px; color: var(--muted); display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
.plan-lines .item.done .item-state { color: var(--ok); }
.plan-lines .item.current { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); }
.plan-lines .item.current .item-title { font-weight: 500; }
.now-badge { padding: 3px 10px; border-radius: 12px; background: var(--ok); color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap; }
.plan-done .plan-head h2 { color: var(--muted); }

/* Результаты курса и разбор попытки */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; background: var(--surface); border-radius: 6px; box-shadow: var(--shadow); margin: 0 0 16px; }
.fact { padding: 18px 24px; border-left: 1px solid var(--line); }
.fact:first-child { border-left: 0; }
.fact-label { font-size: 13px; color: var(--muted); }
.fact-value { font-size: 22px; line-height: 30px; font-weight: 500; }
.steps .step-status { white-space: nowrap; }
.steps .step-actions { white-space: nowrap; }
.step-actions > a { display: block; margin-bottom: 6px; }
.inline-form > summary { cursor: pointer; color: var(--accent-dark); }
.step-actions .inline-form[open] { white-space: normal; width: 280px; max-width: 100%; }
.inline-form textarea { box-sizing: border-box; width: 100%; }
.inline-form form { margin-top: 12px; }
.inline-form textarea { margin-bottom: 12px; }
.status-form { margin-top: 16px; }
.status-form p { margin: 0 0 8px; }
.report-search { width: 320px; max-width: 100%; margin: 0 0 16px; }
/* На сером фоне отчёта поле поиска — белое с рамкой, как поля периода (25.11.2026) */
.report-search input { background-color: #fff; border: 1px solid #c9d0d6; }
.report-search input:hover, .report-search input:focus { border-color: var(--muted); }
.found p { margin: 0 0 8px; }
.found p:last-child { margin: 0; }
.plan-head h2 a, .plan-lines .item-title a { color: inherit; text-decoration: none; }
.plan-head h2 a:hover, .plan-lines .item-title a:hover { text-decoration: underline; }
.done-track summary { cursor: pointer; }
.done-track div { padding: 6px 0 0 16px; }
.attempt-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.attempt-meta p { margin: 0 0 8px; }
.attempt-meta p:last-child { margin: 0; }
.qa { padding: 20px 24px; }
.qa-title { font-weight: 500; margin: 0 0 4px; }
.qa-options { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 14px; }
.qa-options th { font-weight: 500; color: var(--muted); text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.qa-options td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.qa-options th:nth-child(-n+2), .qa-mark { width: 1%; text-align: center; }
.qa-hit { background: #eef8f1; }
.qa-miss { background: #fdeeec; }
.qa-note { color: #8a6100; background: #fff3d6; border-radius: 4px; padding: 6px 10px; }
.qa-result { margin: 8px 0 0; text-align: right; font-size: 14px; }

/* Вход */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
  /* Картинка — из шаблона (случайный фон); человек справа, поэтому при обрезке держим правую часть */
  background: #8fd36f 78% center / cover no-repeat;
}
/* Узкий вертикальный экран: фото сверху, карточка внизу — лицо не закрыто */
@media (max-aspect-ratio: 1/1) {
  .login-page { align-items: flex-end; background-size: 230% auto; background-position: 85% top; }
}
.login-card { width: 446px; max-width: 100%; background: var(--surface); border-radius: 8px; padding: 33px 46px; }
.login-card h1 { text-align: center; font-size: 22px; line-height: 30px; font-weight: 400; margin-bottom: 24px; }
.login-card .logo { display: block; margin: 0 auto 16px; max-height: 48px; }
.login-card .btn { width: 100%; padding: 10px; }
.login-card a.btn { box-sizing: border-box; text-align: center; }
.login-card .muted { text-align: center; font-size: 14px; margin: 20px 0 0; }

@media (max-width: 760px) {
  .page, .wrap { padding-left: 16px; padding-right: 16px; }
  .hero { padding: 12px 16px 24px; min-height: 200px; }
  .hero h1, .banner h1 { font-size: 26px; line-height: 32px; }
  .banner { height: 120px; }
  .banner .wrap { padding-bottom: 24px; }
  .card { flex-direction: column; align-items: stretch; gap: 16px; padding: 16px; }
  .thumb { width: 100%; height: 120px; }
  .item { padding: 14px 16px; gap: 12px; flex-wrap: wrap; }
  .item-state { width: 100%; text-align: left; padding-left: 40px; }
  .plan-head { flex-direction: column; gap: 8px; padding: 16px; }
  .plan-meta { text-align: left; }
  .plan .bar { margin: 0 16px 8px; }
  .plan-lines .item { padding: 12px 16px; }
  .plan-lines .item-state { justify-content: flex-start; }
  .hide-m { display: none; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .fact { padding: 12px 16px; }
  .fact:nth-child(odd) { border-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--line); }
  .fact-value { font-size: 18px; line-height: 24px; }
  /* Шаги курса на телефоне — строками-карточками: название, статус, балл и время, под ними действия */
  .steps thead { display: none; }
  .steps tr { display: grid; grid-template-columns: 1fr auto auto auto; column-gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .steps td { padding: 0; border-bottom: 0; }
  .steps .step-actions { grid-column: 1 / -1; padding-top: 8px; white-space: normal; }
  .steps .step-actions:empty { display: none; }
  .step-actions > a { display: inline-block; margin: 0 16px 6px 0; }
  .step-actions .inline-form[open] { width: 100%; }
  .qa-options th { white-space: normal; font-size: 12px; padding: 6px; }
  .qa-options td { padding: 8px 6px; }
  .qa { padding: 16px; }
  .attempt-head { flex-direction: column; }
  .panel { padding: 16px; }
  .login-card { padding: 24px 20px; }
  .toolbar .wrap { flex-wrap: wrap; }
  .search { width: 100%; }
}

/* Проверка заданий */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.filters select { max-width: 100%; }
.review-task { margin: 8px 0 0; }
.review-task summary { cursor: pointer; color: var(--muted); }
.review-answer { margin: 16px 0; padding: 16px; background: var(--pill); border-radius: 6px; white-space: normal; }
.review-file { margin: 12px 0; }
.review-file img, .review-file video { display: block; max-width: 100%; max-height: 480px; border-radius: 6px; margin-bottom: 4px; }
.review-form { margin-top: 24px; }
.review-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Подсказка логина на странице входа */
.suggest { position: relative; }
.suggest input { width: 100%; }
.suggest-list {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 10; margin: 4px 0 0; padding: 4px 0; list-style: none;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; box-shadow: var(--shadow);
  max-height: 280px; overflow-y: auto; text-align: left;
}
.suggest-list li { padding: 8px 12px; cursor: pointer; }
.suggest-list li:hover, .suggest-list li[aria-selected="true"] { background: var(--pill); }

/* Печать разбора попытки и результатов курса: без шапки, меню и кнопок */
@media print {
  .topbar, .sidenav, .no-print, .msg-success { display: none !important; }
  .shell-main { margin: 0 !important; padding: 0 !important; }
  body { background: #fff; }
  .page { max-width: none; padding: 0; }
  .panel, .facts, .table-wrap { box-shadow: none; border: 1px solid #ddd; }
  .qa { break-inside: avoid; }
}

/* «Посмотреть как сотрудник» (решение 19.11.2026) */
.preview-bar { position: sticky; top: var(--top-h, 64px); z-index: 30; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 24px; background: #2f3a45; color: #fff; font-size: 14px; }
.preview-bar[hidden] { display: none; }
.preview-draft { color: #ffd77a; }
.preview-bar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.preview-bar-btn { display: inline-block; padding: 6px 12px; border: 1px solid rgba(255, 255, 255, .45); border-radius: 6px; color: #fff; font-size: 13px; text-decoration: none; white-space: nowrap; }
.preview-bar-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.preview-bar-close { border-color: var(--accent); background: var(--accent); }
.preview-phone-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 16px; padding: 10px 16px; border-radius: 8px; background: #2f3a45; color: #fff; }
.preview-phone-bar .muted { color: #c9d1d8; }
.preview-phone-bar .preview-bar-btn { margin-left: auto; }
.preview-phone { display: flex; justify-content: center; }
.preview-phone iframe { width: 390px; height: min(844px, calc(100vh - 200px)); border: 12px solid #1e2226; border-radius: 36px; background: #fff; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
@media (max-width: 700px) { .preview-bar { padding: 8px 12px; } }

/* Меню «…» у шага в «Результатах курса», пересдачи (решение 19.11.2026) */
.step-menu { position: relative; display: inline-block; }
.step-menu > summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 28px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; cursor: pointer; font-weight: 500; letter-spacing: 1px; }
.step-menu > summary::-webkit-details-marker { display: none; }
.step-menu[open] > summary { border-color: var(--accent); }
.step-menu-body { position: absolute; z-index: 20; right: 0; top: calc(100% + 4px); width: 300px; max-width: calc(100vw - 32px); padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, .14); white-space: normal; text-align: left; }
.step-menu-body > a, .step-menu-body > details { display: block; padding: 6px 0; }
.step-actions .step-menu-body .inline-form[open] { width: auto; }
.retake-flag { display: inline-block; margin-right: 8px; padding: 2px 8px; border-radius: 10px; background: #fff3d6; color: #8a5a00; font-size: 12px; text-decoration: none; }
.retake-actions { white-space: nowrap; }
.retake-actions form { display: inline; }
.retake-actions .inline-form { display: inline-block; margin-left: 12px; vertical-align: middle; }
.retake-actions .inline-form[open] { display: block; margin: 8px 0 0; white-space: normal; width: 280px; }
.panel.retake h2 { margin-top: 0; }
@media (max-width: 700px) { .step-menu-body { right: auto; left: 0; } .retake-actions { white-space: normal; } }

/* Задание: критерии, оценка, файл проверяющего (решение 19.11.2026) */
.review-criteria { margin: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; }
.review-criteria legend { padding: 0 6px; font-weight: 500; }
.review-criteria label { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0; font-weight: 400; }
.review-criteria input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--accent-dark); }
.review-extra { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.review-extra label { flex: 1 1 220px; }
.review-extra input[type=number] { max-width: 120px; }
.checklist { margin: 8px 0; padding: 0; list-style: none; font-size: 14px; }
.checklist li { margin: 2px 0; }
.checklist .ok { color: var(--ok, #2e7d32); }
.checklist .miss { color: var(--bad, #c62828); }
.assignment-criteria { margin: 16px 0; padding: 12px 16px; border-radius: 8px; background: var(--pill); }
.assignment-criteria ul { margin: 6px 0 0; padding-left: 20px; }

/* Подсказка, почему урок пока нельзя завершить (решение 19.11.2026) */
.lesson-gate-msg { position: fixed; left: 50%; bottom: 24px; z-index: 50; max-width: min(560px, calc(100vw - 32px)); padding: 14px 18px; border-radius: 12px; background: #263238; color: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.2); transform: translate(-50%, 140%); transition: transform .25s; }
.lesson-gate-msg.on { transform: translate(-50%, 0); }

/* Мой профиль (решение 19.11.2026) */
.profile-head { display: flex; gap: 20px; align-items: center; margin-bottom: 12px; }
.profile-head h1 { margin: 0 0 4px; }
.profile-head p { margin: 0; }
.profile-photo { flex: none; width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }
.profile-photo-empty { display: inline-flex; align-items: center; justify-content: center; background: #e9f7e1; color: #3f7d2a; font-size: 40px; font-weight: 600; }

/* Отчёт «Структура» (решение 19.11.2026) */
.report.structure .st-l1 td { background: #f1fae9; }
.report.structure .st-l2 td:first-child { padding-left: 24px; }
.report.structure .st-l3 td:first-child { padding-left: 48px; }

/* Сообщения (решение 22.11.2026): как чат iSpring — слева диалоги, справа переписка; на телефоне по очереди */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.page-chat { padding-bottom: 24px; }
.chat {
  display: grid; grid-template-columns: 340px minmax(0, 1fr);
  height: calc(100vh - var(--top-h) - 48px); height: calc(100dvh - var(--top-h) - 48px); min-height: 440px;
  background: var(--surface); border-radius: 6px; box-shadow: var(--shadow); overflow: hidden;
}
.chat-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.chat-list-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 8px; }
.chat-list-head h1 { flex: 1; margin: 0; font-size: 22px; line-height: 30px; }
.chat-new { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; }
.chat-new:hover { background: var(--accent-dark); }
.chat-search { width: auto; margin: 0 16px 8px; }
.chat-items { flex: 1; min-height: 0; overflow-y: auto; }
.chat-item { display: flex; gap: 12px; align-items: center; padding: 10px 16px; color: var(--text); text-decoration: none; }
.chat-item:hover { background: #f5f6f6; }
.chat-item.on { background: var(--accent-soft); }
.chat-item[hidden] { display: none; }
.chat-ava {
  flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: #e9f7e1; color: #3f7d2a; font-weight: 500; font-size: 14px;
}
.chat-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-item-main { flex: 1; min-width: 0; display: block; }
.chat-item-top, .chat-item-bottom { display: flex; align-items: center; gap: 8px; }
.chat-item-name { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item-time { flex: none; font-size: 12px; color: var(--muted); }
.chat-item-last { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item.unread .chat-item-last { color: var(--text); }
.chat-unread { flex: none; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--ok); color: #fff; font-size: 12px; font-weight: 500; line-height: 20px; text-align: center; }
.chat-none, .chat-pick-none { padding: 12px 16px; margin: 0; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-empty { margin: auto; padding: 24px; text-align: center; }
.chat-head { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 20px; border-bottom: 1px solid var(--line); }
.chat-head-main { flex: 1; min-width: 0; }
.chat-head-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-profile { flex: none; font-size: 14px; text-decoration: none; }
.chat-profile:hover { text-decoration: underline; }
.chat-back { display: none; flex: none; width: 32px; height: 32px; margin-left: -8px; align-items: center; justify-content: center; border-radius: 50%; color: var(--text); font-size: 20px; text-decoration: none; }
.chat-back:hover { background: var(--pill); }
.chat-thread { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 20px 16px; background: #f7f8f8; display: flex; flex-direction: column; }
.chat-earlier { text-align: center; margin: 0 0 8px; font-size: 14px; }
.chat-day { text-align: center; margin: 12px 0 8px; }
.chat-day span { display: inline-block; padding: 2px 12px; border-radius: 12px; background: var(--pill); color: var(--muted); font-size: 12px; }
.bubble-row { display: flex; margin: 3px 0; }
.bubble-row.mine { justify-content: flex-end; }
.bubble {
  max-width: min(560px, 82%); padding: 8px 12px 5px; border-radius: 12px 12px 12px 4px;
  background: #fff; box-shadow: 0 1px 2px rgba(66, 72, 78, 0.12); overflow-wrap: anywhere;
}
.mine .bubble { border-radius: 12px 12px 4px 12px; background: #e3f5d8; }
.bubble-ref { display: block; margin: 0 0 6px; padding: 4px 10px; border-left: 3px solid var(--accent); border-radius: 2px; background: rgba(150, 219, 121, 0.14); font-size: 14px; text-decoration: none; }
.bubble-ref:hover { text-decoration: underline; }
.bubble-file { display: block; margin: 4px 0 2px; }
.bubble-file img { display: block; max-width: 100%; max-height: 280px; border-radius: 8px; }
.bubble-doc { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.04); text-decoration: none; }
.bubble-doc span { overflow-wrap: anywhere; }
.bubble-time { margin-top: 2px; font-size: 11px; line-height: 14px; color: var(--muted); text-align: right; }
.chat-form { padding: 10px 16px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-form-row { display: flex; align-items: flex-end; gap: 8px; }
.chat-form textarea { flex: 1; min-height: 40px; max-height: 160px; padding: 9px 16px; border-radius: 20px; resize: none; line-height: 20px; }
.chat-send { flex: none; border-radius: 20px; }
.chat-attach { position: relative; flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--muted); cursor: pointer; }
.chat-attach:hover, .chat-attach:focus-within { background: var(--pill); color: var(--text); }
.chat-attach input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.chat-file-name { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.chat-file-name button { margin-left: 8px; }
.chat-errors { margin: 0 0 8px; padding: 8px 12px; border-radius: 6px; background: #fde7e4; font-size: 14px; }
.chat-errors p { margin: 0; }
.chat-ref { margin: 0 0 8px; padding: 6px 10px; border-radius: 6px; background: var(--accent-soft); font-size: 13px; }
.chat-closed { margin: 0; padding: 14px 20px; border-top: 1px solid var(--line); text-align: center; }
.chat-pick { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 0; }
.chat-pick-search { width: auto; margin: 0 16px 4px; }
.chat-pick-title { margin: 14px 16px 4px; font-size: 13px; line-height: 18px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ask-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; text-decoration: none; }
.ask-link:hover { text-decoration: underline; }
.crumb-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }

@media (max-width: 760px) {
  .page-chat { padding: 0; }
  .page-chat > .msg { margin: 8px; }
  .chat { grid-template-columns: minmax(0, 1fr); border-radius: 0; box-shadow: none; min-height: 0;
    height: calc(100vh - var(--top-h)); height: calc(100dvh - var(--top-h)); }
  .chat.chat-open .chat-list { display: none; }
  .chat:not(.chat-open) .chat-main { display: none; }
  .chat-list { border-right: 0; }
  .chat-back { display: inline-flex; }
  .chat-head { padding: 8px 12px; min-height: 56px; }
  .chat-head .chat-ava { width: 36px; height: 36px; }
  .chat-profile { font-size: 13px; }
  .chat-thread { padding: 8px 10px 12px; }
  .bubble { max-width: 88%; }
  .chat-form { padding: 8px 8px 10px; }
  .chat-send { padding: 9px 14px; }
}
/* Сортировка таблиц отчётов щелчком по заголовку (static/js/report-sort.js, 25.11.2026) */
.th-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: inherit; cursor: pointer; }
.th-sort:hover, .th-sort:focus-visible { color: var(--text); }
.report th[aria-sort] .th-sort { color: var(--text); }
.report th[aria-sort="ascending"] .th-sort::after { content: " ↑"; }
.report th[aria-sort="descending"] .th-sort::after { content: " ↓"; }
/* Период «с … по …» в отчётах (25.11.2026) */
.period-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 16px; }
.period-form label { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.period-form input[type=date] { padding: 6px 8px; background: #fff; border: 1px solid #c9d0d6; border-radius: 6px; font: inherit; }
