:root {
  --bg: #f6f7f9; --panel: #fff; --line: #e3e6ea; --text: #1c1f23; --muted: #6b7280;
  --accent: #f5820b; --accent-dark: #d96f00; --ok: #14804a; --warn: #a2601a; --err: #b3261e;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
main { max-width: 1600px; margin: 0 auto; padding: 18px 20px 60px; }
h1 { font-size: 21px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 6px; color: var(--muted); font-weight: 600; }
a { color: var(--accent-dark); }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

.top { display: flex; align-items: center; gap: 24px; padding: 0 20px;
  background: var(--panel); border-bottom: 1px solid var(--line); height: 54px; }
.top .brand { font-weight: 700; }
.top nav { display: flex; gap: 4px; margin-right: auto; }
.top nav a { padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--text); }
.top nav a:hover { background: var(--bg); }
.top nav a.on { background: var(--accent); color: #fff; }
.top .who { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.top .who form { display: inline; }
.role { color: var(--accent-dark); }
button.link { background: none; border: 0; color: var(--muted); cursor: pointer;
  text-decoration: underline; padding: 0; font-size: 13px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin: 16px 0; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

.login { max-width: 360px; margin: 60px auto; }
.stack, .login form { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.row { flex-direction: row; align-items: center; gap: 8px; }
/* Галочке ширина по содержимому: иначе общее правило для input растягивает её на всю строку. */
input[type=checkbox], input[type=radio] { width: auto; flex: none; margin: 0; }
input, select, textarea { font: inherit; color: var(--text); background: #fff;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { font-size: 13px; line-height: 1.5; resize: vertical; width: 100%; }

button, .btn { font: inherit; cursor: pointer; border: 1px solid var(--line); background: #fff;
  color: var(--text); border-radius: 8px; padding: 8px 14px; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { border-color: var(--muted); }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; align-items: center; }
.filters input, .filters select { width: auto; min-width: 130px; font-size: 13px; padding: 6px 8px; }

table.grid { width: 100%; border-collapse: collapse; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.grid th, table.grid td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line);
  vertical-align: middle; white-space: nowrap; }
table.grid td { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
table.grid thead th { background: #fafbfc; font-size: 11px; text-transform: uppercase;
  letter-spacing: .03em; color: var(--muted); position: sticky; top: 0; z-index: 1; }
table.grid thead a.sort { color: inherit; text-decoration: none; display: block; }
table.grid thead a.sort:hover { color: var(--accent-dark); }
table.grid thead a.sort.on { color: var(--accent-dark); font-weight: 700; }
table.grid tbody tr:hover { background: #fcfcfd; }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.compact th, table.compact td { padding: 4px 8px; font-size: 13px; line-height: 1.35; }
.nowrap { white-space: nowrap; }
table.picker td { padding: 6px; }
table.picker select { min-width: 240px; font-size: 13px; padding: 5px 8px; }
table.picker td { vertical-align: top; white-space: normal; max-width: none; }
table.picker td.none { color: var(--muted); background: #fafbfc; }
.by { font-size: 11px; color: var(--muted); margin-top: 2px; }
.hint { background: #fff8ec; border: 1px solid #f3ddb8; padding: 8px 12px; border-radius: 8px;
  font-size: 13px; margin: 10px 0; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px;
  background: #eef0f3; color: var(--muted); }
.tag.new { background: #fff2e0; color: var(--accent-dark); }
.chip { display: inline-block; padding: 1px 6px; border-radius: 5px; background: #eef0f3;
  font-size: 11px; margin-right: 3px; }
.chips { max-width: 420px; white-space: normal; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .error, .err { color: var(--err); }
.error { background: #fdecea; border: 1px solid #f5c6c2; padding: 8px 12px; border-radius: 8px; }
.ok-box { background: #e8f5ee; border: 1px solid #bfe0cd; padding: 8px 12px; border-radius: 8px; margin: 12px 0; }
.empty { color: var(--muted); background: var(--panel); border: 1px dashed var(--line);
  padding: 20px; border-radius: var(--radius); }
.back { display: inline-block; margin-bottom: 10px; text-decoration: none; font-size: 13px; }

dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
pre.note { white-space: pre-wrap; word-break: break-word; background: var(--bg); padding: 12px;
  border-radius: 8px; font-size: 12px; max-height: 320px; overflow: auto; }
ul.days { list-style: none; padding: 0; margin: 0; }
ul.days > li { margin-bottom: 10px; }
ul.days ul { margin: 4px 0 0; padding-left: 18px; }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 10px; }

.newgroup { display: flex; gap: 4px; margin-top: 4px; }
/* display:flex перебивает атрибут hidden — без этой строки поля видны всегда */
.newgroup[hidden] { display: none; }
.newgroup select { min-width: 0; flex: 1; font-size: 12px; padding: 4px 6px; }

.filters label.inline { flex-direction: row; align-items: center; gap: 6px; font-size: 12px; }
.filters input[type=date] { min-width: 140px; }

/* Главный экран: карточка ученика, тест и расписание в одной строке. */
table.board td { vertical-align: top; white-space: normal; max-width: none; padding: 8px; }
table.board .who { width: 220px; }
table.board .who .name { font-weight: 600; }
table.board .test { width: 165px; }
table.board .letter { width: 190px; }
table.board .letter button { width: 100%; margin-bottom: 4px; font-size: 12px; padding: 6px 8px; }
table.board tbody tr { border-bottom: 1px solid var(--line); }

.dayrow { display: flex; gap: 4px; align-items: flex-start; margin-bottom: 4px; }
.daylab { width: 22px; padding-top: 6px; font-weight: 600; color: var(--muted); font-size: 12px; }
.slot { width: 210px; }
.slot select { width: 100%; font-size: 12px; padding: 4px 6px; }
.by.ok { color: var(--ok); }
.by.err { color: var(--err); }
/* Изменение пришло от коллеги, пока страница была открыта. */
.by.remote { color: var(--accent-dark); font-weight: 600; }
/* Урок не своего класса: разрешено, но видно сразу. */
.slot select.mismatch { background: #fff6dc; border-color: #e3b341; }
/* Отдельный класс: клиентская раскраска выбора (mismatch/roomstop) его не снимает. */
.slot select.early:not(.roomstop) { background: #fff6dc; border-color: #e3b341; }
.by.warn { color: var(--warn); font-weight: 600; }
.by[hidden] { display: none; }
/* У старших ячейка — время урока: подписываем его над выбором. */
.slottime { font-size: 11px; font-weight: 700; color: var(--accent-dark); margin-bottom: 2px; }
/* Урок раньше времени прихода: выбран не тот урок или в ERP неверное время прихода. */
.slottime.early { color: var(--warn); background: #fff6dc; border-radius: 4px; padding: 0 4px; display: inline-block; cursor: help; }
/* Дни в форме стопа кабинета — в одну строку, галочка рядом с днём. */
.daypick { display: inline-flex; gap: 8px; align-items: center; }
.daypick label.row { gap: 3px; font-size: 13px; color: var(--text); }
/* Урок в кабинете под стопом: выбрать можно, но с красной пометкой. */
.slot select.roomstop { background: #fdecea; border-color: #e8a19b; }
.pager { display: flex; gap: 10px; align-items: center; margin: 14px 0; }
details summary { font-size: 12px; }
table.board pre.note { max-height: 200px; font-size: 11px; }

.profile { font-size: 11px; color: var(--accent-dark); margin-top: 3px; font-weight: 600; line-height: 1.3; }
table.board .test .tag { margin-top: 3px; font-size: 10px; }

/* Ученик, у которого расписание собрали все кафедры. */
table.board tr.ready { background: rgba(20, 128, 74, .10); }
table.board tr.ready td { border-bottom-color: rgba(20, 128, 74, .25); }
.ready-note { font-size: 10px; color: var(--muted); line-height: 1.25; margin: 6px 0 3px; }
.ready-btn { width: 100%; font-size: 12px; padding: 6px 8px; }
tr.ready .ready-btn { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 600; }

table.summary td.num, table.summary th.num { text-align: right; }

table.summary tfoot th { background: #fafbfc; }
.left { color: var(--err); text-decoration: none; font-weight: 600; }
.left:hover { text-decoration: underline; }

.cards { display: grid; gap: 14px; }
.card.teacher h2 { display: flex; gap: 8px; align-items: baseline; }
.card.teacher table { margin-bottom: 10px; }

/* Сводка под фильтрами */
.summary-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin: 12px 0; }
.summary-box .totals { display: flex; gap: 22px; font-size: 15px; margin-bottom: 10px; }
.summary-box .totals b { font-size: 19px; }
table.mini { max-width: 720px; }
table.mini td, table.mini th { font-size: 12px; padding: 3px 8px; }
.btn.small { font-size: 12px; padding: 4px 10px; margin-top: 8px; }

/* Карточка ученика */
.who .info { margin-top: 6px; }
.info-text { font-size: 11px; line-height: 1.35; color: var(--muted); white-space: pre-wrap;
  max-height: 54px; overflow: hidden; }
.info-text.open { max-height: none; position: relative; z-index: 2; background: var(--panel);
  width: 640px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
a.wa { display: inline-block; vertical-align: -3px; margin-left: 4px; line-height: 0; }
a.wa svg { width: 16px; height: 16px; fill: #25d366; }
a.wa:hover svg { fill: #128c7e; }

/* Перенос расписания и готовность */
/* Фильтр с галочками: можно выбрать сразу несколько классов или филиалов. */
.multi { position: relative; display: inline-block; }
.multi > summary { list-style: none; cursor: pointer; padding: 6px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; font-size: 13px; white-space: nowrap; }
.multi > summary::-webkit-details-marker { display: none; }
.multi > summary::after { content: " ▾"; color: var(--muted); }
.multi > summary.on { border-color: var(--accent); color: var(--accent-dark); font-weight: 600; }
.multi-list { position: absolute; z-index: 30; margin-top: 4px; min-width: 180px; max-height: 320px; overflow: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
/* Галочка слева от значения, в одну строку. Общие правила для подписей (колонкой)
   и для полей фильтров (минимум 130 пикселей ширины) сюда не подходят — перебиваем. */
.multi-list label { display: flex; flex-direction: row; gap: 8px; align-items: center; padding: 5px 8px;
  border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text); white-space: nowrap; }
.multi-list input[type=checkbox] { width: 16px; height: 16px; min-width: 0; padding: 0; margin: 0; flex: none;
  accent-color: var(--accent); cursor: pointer; }
.multi-list label:hover { background: #f4f6fa; }
.multi-list .link { margin-top: 4px; font-size: 12px; }

/* Ученик пришёл переводом из другого филиала, а не с нуля. */
.tag.move { background: #eef4ff; border-color: #c7d7f5; color: #2c4a80; }

/* Копирование одного дня: неброско, пока строку не трогают. */
.daytools { display: inline-flex; gap: 6px; align-items: center; padding-top: 4px; }
.daytools .link { font-size: 11px; opacity: .45; }
.dayrow:hover .daytools .link, .daytools .link:focus { opacity: 1; }
.rowtools { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.rowtools .link { font-size: 11px; }
table.board tr.half { background: rgba(245, 130, 11, .08); }
table.board tr.half td { border-bottom-color: rgba(245, 130, 11, .25); }
.ready-btn.on { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 600; }

.card.teacher .shift { margin-bottom: 14px; }
.card.teacher .shift h3 { font-size: 13px; color: var(--accent-dark); text-transform: uppercase;
  letter-spacing: .04em; margin: 0 0 6px; }

/* Свободные места: сводка «класс × смена» и подробности по дням. */
table.seats td, table.seats th { text-align: center; vertical-align: middle; }
table.seats th.rowhead { text-align: left; font-weight: 600; white-space: nowrap; }
table.seats thead th .muted { font-size: 10px; text-transform: none; letter-spacing: 0; }
td.seat { padding: 8px 10px; }
td.seat .lab { font-size: 13px; margin-top: 3px; }
td.seat .lab b { font-size: 17px; }
td.seat .sub { font-size: 11px; color: var(--muted); }
/* Полоса заполненности: сразу видно, сколько смены уже занято. */
.bar { height: 9px; border-radius: 5px; background: #dde1e6; overflow: hidden;
  max-width: 130px; margin: 0 auto; box-shadow: inset 0 0 0 1px rgba(0,0,0,.04); }
.bar span { display: block; height: 100%; background: var(--ok); }
.bar-warn span { background: #d99a29; }
.bar-full span { background: var(--err); }
.bar-fresh span, .bar-none span { background: #9aa3ad; }

.verdict { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin: 12px 0; line-height: 1.9; }
.verdict .sub { margin-top: 6px; font-size: 13px; color: var(--muted); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 13px; margin-right: 4px; }
.pill.ok { background: #e8f5ee; color: #10633a; }
.pill.no { background: #fdecea; color: #8f2019; }
.pill.none { background: #eef0f3; color: var(--muted); }
td.seat.nogroups .bar { background: repeating-linear-gradient(90deg, #e4e7ea 0 6px, #edeff2 6px 12px); }
details.how summary { margin: 8px 0; }

/* Загрузка филиала: смены потока и разбор по классам. */
table.load td { text-align: center; }
table.load td .bar { margin-top: 4px; max-width: 90px; }
table.load th.rowhead { text-align: left; white-space: nowrap; }
table.load th.rowhead.sub { padding-left: 22px; font-weight: 400; color: var(--muted); }
table.load tr.row-open { cursor: pointer; }
table.load tr.row-open:hover td, table.load tr.row-open:hover th { background: #fafbfc; }
table.load tr.grade td, table.load tr.grade th { font-size: 12px; padding-top: 3px; padding-bottom: 3px; }
table.load tr.details td { background: #fbfcfd; padding: 8px 12px; }
.streamcard { padding: 14px 16px; }
.streamcard h2 { margin-bottom: 8px; }
.names { display: flex; flex-wrap: wrap; gap: 4px 10px; max-height: 260px; overflow: auto; }
.names .name { font-size: 12px; color: var(--muted); background: #fff;
  border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; }
.names .name b { color: var(--text); font-weight: 600; }
.seat-ok { background: #e8f5ee; }
.seat-warn { background: #fff8ec; }
.seat-full { background: #fdecea; }
.seat-none, .seat-empty { background: #f2f3f5; color: var(--muted); }
tr.seat-row-full td { background: #fdecea; }
tr.seat-row-warn td { background: #fff8ec; }
tr.seat-row-stale td { background: #f7f8f9; color: var(--muted); }
/* Индивидуальные и доп. занятия: кабинет занят, но мест они не дают. */
tr.seat-row-closed td { background: #f7f8f9; color: var(--muted); }
.chip.shut { background: #f0f1f3; color: var(--muted); text-decoration: none; }
/* Новая группа под набор: не ошибка, а место, куда можно сажать. */
tr.seat-row-fresh td { background: #f3f8ff; }
.tag.stale { background: #eceef1; color: var(--muted); }
details.day summary { color: var(--text); font-size: 15px; margin: 0; }
details.day > h3 { margin: 14px 0 6px; }
.room { margin-bottom: 8px; }
.roomname { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }

/* Кабинеты: места по кабинетам и стоп на запись. */
.roomgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 10px 0 14px; }
.roomcell { border: 1px solid var(--line); border-radius: 8px; padding: 8px; gap: 4px; background: #fff; }
.roomcell .num { font-weight: 700; color: var(--text); font-size: 15px; }
.roomcell input { padding: 5px 8px; font-size: 14px; }
.roomcell.custom { border-color: var(--accent); background: #fffaf3; }
button.danger { background: var(--err); border-color: var(--err); color: #fff; font-weight: 600; }
button.danger:hover { background: #8f2019; border-color: #8f2019; }
.stopform select, .stopform input { min-width: 120px; }
.stopform input[name=note] { min-width: 220px; }
.stoptag, .tstop { display: inline-block; background: var(--err); color: #fff; font-weight: 700;
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase; border-radius: 5px; padding: 2px 7px; }
table.stops td { white-space: normal; }

/* Стоп в сводке мест: красная клетка вместо цифры. */
td.seat.stopcell { background: #fdecea; }
.stopword { color: var(--err); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 15px; }
.pill.stop { background: #fdecea; color: #8f2019; font-weight: 600; }

/* Плитки кабинетов на экране менеджера. */
.segbar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.segbtn { border: 0; border-radius: 0; padding: 7px 14px; background: #fff; font-size: 13px; }
.segbtn + .segbtn { border-left: 1px solid var(--line); }
.segbtn.on { background: var(--accent); color: #fff; font-weight: 600; }
.tilegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.tile { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 8px 9px 9px;
  background: #fff; min-height: 92px; }
.tile .tnum { font-weight: 800; font-size: 16px; }
.tile .tocc { font-size: 20px; font-weight: 700; line-height: 1.2; }
.tile .tocc span { font-size: 13px; color: var(--muted); font-weight: 400; }
.tile .tbar { height: 6px; border-radius: 3px; background: #e6e8eb; overflow: hidden; margin: 4px 0 5px; }
.tile .tbar span { display: block; height: 100%; background: var(--ok); }
.tile .tsub { font-size: 11px; line-height: 1.35; }
.tile .tfree { font-size: 14px; color: var(--ok); font-weight: 700; margin: 6px 0 2px; }
.tile .tstop { position: absolute; top: 7px; right: 7px; font-size: 10px; padding: 1px 5px; }
.tile.t-ok { border-color: #bfe0cd; }
.tile.t-warn { border-color: #f0d39c; background: #fffaf0; }
.tile.t-warn .tbar span { background: #d99a29; }
.tile.t-full { border-color: #f1b4ae; background: #fdf1ef; }
.tile.t-full .tbar span { background: var(--err); }
.tile.t-empty { border: 1px dashed #9ccfb2; background: #f4fbf7; }
.tile.t-fresh { border-color: #b9d3f3; background: #f3f8ff; }
.tile.t-closed { background: #f5f6f8; color: var(--muted); }
.tile.t-closed .tbar span { background: #a9b0b8; }
.tile.t-stop { border: 2px solid var(--err); background: #fdecea; }
.tile.t-stop .tbar span { background: var(--err); }
.legend { color: var(--muted); margin-top: 10px; line-height: 2; }
.legend .lg { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px;
  margin: 0 4px 0 10px; border: 1px solid var(--line); }
.legend .lg:first-child { margin-left: 0; }
.lg.t-ok { background: #e8f5ee; border-color: #bfe0cd; }
.lg.t-warn { background: #fffaf0; border-color: #f0d39c; }
.lg.t-full { background: #fdf1ef; border-color: #f1b4ae; }
.lg.t-empty { background: #f4fbf7; border: 1px dashed #9ccfb2; }
.lg.t-fresh { background: #f3f8ff; border-color: #b9d3f3; }
.lg.t-closed { background: #f5f6f8; }
.lg.t-stop { background: #fdecea; border: 2px solid var(--err); }

.segbtn small { display: block; font-size: 10px; opacity: .75; font-weight: 400; }

/* ——— Отступы между значениями: чтобы было видно, что к чему относится ——— */

/* Сводка мест: главная цифра, под ней подсказка, «ждут» — отдельно под чертой. */
table.seats th, table.seats td { padding: 10px 12px; }
table.seats td.seat { min-width: 150px; }
td.seat .lab { margin-top: 7px; font-size: 13px; }
td.seat .lab b { font-size: 18px; margin-right: 3px; }
td.seat .cellhint { margin-top: 4px; font-size: 11px; color: var(--muted); line-height: 1.35; }
td.seat .wait { margin-top: 7px; padding-top: 5px; border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--muted); }
td.seat .wait b { color: var(--text); font-size: 13px; margin-left: 2px; }
td.seat.stopcell .cellhint { color: #8f2019; }

/* Вывод над сводкой: заголовок строки отдельно, метки с воздухом, значения — значками. */
.verdict { line-height: 1.5; padding: 14px 16px; }
.verdict .vline + .vline { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.verdict .vhead { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.verdict .stopline .vhead { color: var(--err); }
.verdict .vpills { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.verdict .vnote { margin-top: 6px; font-size: 12px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 4px 10px;
  border-radius: 16px; font-size: 13px; line-height: 1.3; }
.pill b { font-weight: 700; }
.pill .pday { font-size: 11px; opacity: .7; }
.pill .pv { background: rgba(255, 255, 255, .75); border-radius: 10px; padding: 1px 7px; font-weight: 600; }

/* Плитки кабинетов: номер, занятость, классы — каждое своей строкой. */
.tile { display: flex; flex-direction: column; gap: 3px; padding: 10px 11px 11px; }
.tile .tnum { margin-bottom: 2px; }
.tile .tbar { margin: 3px 0 4px; }
.tile .tsub + .tsub { margin-top: 1px; }

/* Загрузка: пометка «+N инд./доп.» — под числом, а не впритык к нему. */
table.load th, table.load td { padding: 9px 12px; }
table.load td .muted[title] { display: block; font-size: 11px; margin-top: 2px; }
table.load tr.grade th, table.load tr.grade td { padding-top: 5px; padding-bottom: 5px; }
details.streamcard > summary { font-size: 15px; color: var(--text); margin: 0 0 4px; padding: 2px 0; }
details.streamcard[open] > summary { margin-bottom: 10px; }

/* Подробности на экране мест — одним блоком под кнопкой. */
details.more > summary { font-size: 14px; color: var(--text); font-weight: 600; margin: 0; }
details.more[open] > summary { margin-bottom: 12px; }
details.more h3 { margin: 16px 0 8px; color: var(--text); }

/* Уроки блока в разборе по дням: зазор между значками. */
td.chips .chip { margin: 2px 5px 2px 0; padding: 2px 7px; }

.legend { margin: 6px 0 12px; }
.legend .lg.t-ok { background: var(--ok); border-color: var(--ok); }
.legend .lg.t-warn { background: #d99a29; border-color: #d99a29; }
.legend .lg.t-full { background: var(--err); border-color: var(--err); }
.legend .lg.t-empty { background: #fff; border: 1.5px dashed #6fb58d; }
.legend .lg.t-fresh { background: #cfe2fb; border-color: #8fb6ea; }
.legend .lg.t-closed { background: #c9ced5; border-color: #b3b9c1; }
.legend .lg.t-stop { background: #fff; border: 2px solid var(--err); }

/* Строка очереди: сколько новичков уже в группах ERP и сколько правда ждёт. */
.queue { margin: 6px 0 12px; font-size: 14px; }
.queue b { font-size: 15px; }
.queue .sep { color: var(--muted); margin: 0 7px; }
.queue .small { margin-left: 10px; }

/* «13 каб.» — подпись к номеру кабинета, мельче номера. */
.tile .tnum span { font-size: 12px; font-weight: 600; color: var(--muted); }

/* ——— Сводка по группам, как на макете: фильтр кнопками сверху, сетка линий ——— */
:root { --bar-ok: #22b07d; --bar-warn: #eea20a; }
.bar-ok span { background: var(--bar-ok); }
.bar-warn span { background: var(--bar-warn); }
.tile .tbar span { background: var(--bar-ok); }
.tile.t-warn .tbar span { background: var(--bar-warn); }
.legend .lg.t-ok { background: var(--bar-ok); border-color: var(--bar-ok); }
.legend .lg.t-warn { background: var(--bar-warn); border-color: var(--bar-warn); }

.seatsbox { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px 16px; margin: 12px 0; }
.seatsfilter { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.seatsfilter .muted { font-size: 13px; margin-right: 2px; }
.pillselect { width: auto; min-width: 0; border: 1px solid #d3d8de; border-radius: 10px;
  padding: 6px 14px; font-size: 14px; background: #fff; color: var(--text); cursor: pointer;
  -webkit-appearance: none; appearance: none; }
.pillselect:hover { border-color: var(--muted); }

.seatsbox table.seats { width: 100%; border-collapse: collapse; }
.seatsbox table.seats th, .seatsbox table.seats td { border: 1px solid #dfe3e7; padding: 12px 14px;
  text-align: center; vertical-align: middle; background: #fff; }
.seatsbox table.seats thead th { font-size: 15px; font-weight: 600; text-transform: none; letter-spacing: 0;
  color: var(--text); position: static; }
.seatsbox table.seats .shhours { font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 3px; }
.seatsbox table.seats th.grouphead, .seatsbox table.seats th.rowhead { text-align: left; width: 1%;
  white-space: nowrap; padding-right: 26px; }
.seatsbox table.seats th.rowhead b { font-size: 15px; font-weight: 700; }
.seatsbox table.seats th.rowhead .stream { font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 3px; }

.seatsbox td.seat { min-width: 160px; padding: 12px 14px; }
.seatsbox td.seat .bar { max-width: none; height: 8px; border-radius: 4px; margin: 0 0 10px; background: #e3e6ea; }
.seatsbox td.seat .lab { margin-top: 0; font-size: 15px; }
.seatsbox td.seat .lab b { font-size: 24px; font-weight: 600; margin-right: 4px; }
.seatsbox td.seat .lab .word { font-weight: 700; font-size: 15px; color: var(--text); }
.seatsbox td.seat .wait { border-top: 0; padding-top: 0; margin-top: 4px; font-size: 13px; color: var(--muted); }
.seatsbox td.seat .wait b { color: var(--muted); font-weight: 600; font-size: 13px; }
/* «Ждут 15 → не хватит 3»: нехватку показываем красным, как и в «Загрузке». */
.seatsbox td.seat .wait .err, .seatsbox td.seat .wait .err b { color: var(--err); }
.seatsbox td.seat.stopcell { background: #fdecea; }
.seatsbox tr.nomatch td { text-align: center; padding: 18px; }

/* Часы смен на вкладке «Кабинеты». */
table.hoursgrid { width: auto; margin: 8px 0 10px; }
table.hoursgrid td { white-space: nowrap; color: var(--muted); }
table.hoursgrid input[type=time] { width: 120px; margin-left: 6px; }
label.allcity { margin: 0 0 12px; font-size: 13px; }
/* Два набора часов — обычный и ЕНТ — разделены чертой, кнопки в строку. */
.hoursblock + .hoursblock { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.hoursblock h3 { font-size: 14px; color: var(--text); }
.hoursbtns { display: flex; align-items: center; gap: 16px; }
.shent { font-size: 10px; color: var(--accent-dark); font-weight: 600; letter-spacing: 0; text-transform: none; }
.entmark { display: inline-block; font-size: 10px; font-weight: 700; color: var(--accent-dark);
  background: #fff2e0; border-radius: 4px; padding: 0 4px; margin-left: 4px; vertical-align: middle; }
.inline-form { display: inline; margin-left: 12px; }

/* ЕНТ по направлениям: строки — время, колонки — пары профильных предметов. */
.viewtabs { margin-bottom: 12px; }
table.ent th, table.ent td { text-align: center; }
table.ent th.rowhead { text-align: left; white-space: nowrap; font-weight: 600; }
table.ent thead th { font-size: 12px; }
table.ent thead th .muted { font-size: 10px; text-transform: none; letter-spacing: 0; font-weight: 400; }
table.ent td { min-width: 64px; font-size: 15px; }
table.ent td b { font-size: 17px; }
td.ent-ok { background: #e8f5ee; }
td.ent-warn { background: #fff8ec; }
td.ent-full { background: #fdecea; }
td.ent-none { background: #f5f6f8; color: var(--muted); }
/* Стоп читается так же, как в сводке: красная клетка и слово вместо цифры. */
td.ent-stop { background: #fdecea; color: var(--err); font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }

td.ent-part { background: #fbfbfc; color: var(--muted); font-size: 12px; line-height: 1.4; }
td.ent-part .only { display: block; white-space: nowrap; }
td.ent-full { color: var(--err); font-weight: 700; font-size: 13px; }
td.ent-full .entwhy { font-size: 10px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.tile .tsub.tsubj { font-weight: 700; color: var(--accent-dark); }

/* Переводы: карточка ученика — откуда и куда, где сидит сейчас и выбор новых групп. */
.who-line { font-size: 15px; margin-bottom: 4px; }
.route { font-size: 14px; margin: 2px 0 4px; }
.route .arrow { color: var(--accent-dark); font-weight: 700; margin: 0 4px; }
.transfer-cols { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 20px; margin-top: 12px; }
@media (max-width: 1000px) { .transfer-cols { grid-template-columns: 1fr; } }
.transfer-cols h3 { margin-bottom: 6px; }
.transfer-cols .dayrow { flex-wrap: wrap; }
ul.oldgroups { list-style: none; padding: 0; margin: 0 0 8px; font-size: 13px; }
ul.oldgroups li { padding: 3px 0; border-bottom: 1px dashed var(--line); }
ul.oldgroups li:last-child { border-bottom: 0; }
.transfer-actions { display: flex; gap: 16px; align-items: center; margin-top: 12px; }
.transfer-actions form { display: inline; }
.transferform { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 14px;
  align-items: end; margin-top: 12px; }
.transferform .wide, .transferform .daypick-field { grid-column: 1 / -1; }
.transferform > button { justify-self: start; }
.daypick-field { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.transfer-new { margin-top: 14px; }

/* Сессия в браузере сменилась — крупно, сверху, один раз. */
.session-note { margin: 0 0 12px; font-weight: 600; }

/* Список тренерам: группа начинается чертой, две кнопки текста рядом. */
.card.teacher tr.group-first td { border-top: 2px solid var(--line); }
.copy-pair { display: flex; gap: 8px; margin-top: 10px; }

/* Список тренерам: отправка в приложение */
.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 2px 0 10px; font-size: 13px; }
.notice .small { flex-basis: 100%; }
.notifybar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 8px 0 14px; padding: 10px 14px;
  background: #fff8ec; border: 1px solid #f1dfbd; border-radius: 10px; font-size: 14px; }
.notifyform { display: inline; margin: 0; }
