/* Токены и компоненты по макету designs/02 · Студенты (pen.dev). */

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-cyrillic.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #F3F5F9;
  --surface: #FFFFFF;
  --surface-2: #F8F9FC;
  --ink: #0F1D3A;
  --ink-2: #55657F;
  --ink-3: #8592A8;
  --line: #E2E7EF;
  --line-strong: #CDD5E1;
  --primary: #2459E0;
  --primary-soft: #EBF1FE;
  --success: #15803D;
  --success-soft: #E7F6EC;
  --danger: #C8282E;
  --danger-soft: #FCEBEC;
  --warn: #C2610C;
  --warn-soft: #FDF1E3;
  --violet: #6D3FD6;
  --violet-soft: #F1ECFD;
  --side-bg: #0B1A36;
  --side-active: #1B3264;
  --side-panel: #13244A;
  --side-line: #1E3058;
  --side-ink: #AEBAD2;
  --side-muted: #6F7F9E;
  --avatar: #3B5BA5;
  --shadow: 0 1px 2px #0F1D3A0D;
  --shadow-pop: 0 8px 24px #0F1D3A26;
}

*, ::before, ::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 13px/1.35 Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }

.icon {
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.muted { color: var(--ink-3); }
.dash { color: var(--ink-3); }
.text-success { color: var(--success); }
.text-warn { color: var(--warn); }
.text-danger { color: var(--danger); }

/* Пустышка: элемент из макета, функция которого ещё не реализована. */
.stub { opacity: .5; cursor: not-allowed; }
.stub:hover { text-decoration: none; }

/* --- Каркас декана --- */

/* Фон сайдбара на всю высоту страницы (сам сайдбар — sticky на высоту экрана). */
.app { display: flex; min-height: 100vh; background: linear-gradient(to right, var(--side-bg) 232px, transparent 232px); }

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex-shrink: 0;
  width: 232px;
  height: 100vh;
  padding: 20px 12px 16px;
  background: var(--side-bg);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
}
.brand-name { color: #fff; font-size: 16px; font-weight: 700; }
.brand-tag { color: var(--side-muted); font-size: 11px; margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-caption {
  margin-bottom: 6px;
  padding: 0 12px;
  color: var(--side-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--side-ink);
  font-size: 14px;
  font-weight: 500;
}
.nav-item:hover { background: var(--side-panel); text-decoration: none; }
.nav-item.active { background: var(--side-active); color: #fff; font-weight: 600; }
.nav-item.stub:hover { background: none; }

.sidebar-spacer { flex: 1; }
.today {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--side-panel);
  color: var(--side-ink);
}
.today-label { color: var(--side-muted); font-size: 11px; }
.today-date { color: #fff; font-size: 13px; font-weight: 600; margin-top: 2px; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 6px 0;
  border-top: 1px solid var(--side-line);
  margin-top: -12px;
}
.sidebar-user .user-name { color: #fff; }
.sidebar-user .user-role { color: var(--side-muted); }
.logout { margin-left: auto; }
.logout button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--side-muted);
  cursor: pointer;
}
.logout button:hover { background: var(--side-panel); color: #fff; }

.avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--avatar);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--ink-3); margin-top: 1px; }

.main { display: flex; flex-direction: column; flex: 1; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--ink-3); white-space: nowrap; }
.crumbs a { color: var(--ink-3); }
.crumbs .current { color: var(--ink); font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.global-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 280px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-3);
}
.global-search .kbd {
  margin-left: auto;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  font-size: 11px;
}
.year-select { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.year-select b { color: var(--ink); font-weight: 600; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink-2);
}
.topbar-divider { width: 1px; height: 28px; background: var(--line); }
.topbar-user { display: flex; align-items: center; gap: 10px; }

.content { display: flex; flex-direction: column; gap: 16px; padding: 24px 24px 32px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -.3px; }
.page-subtitle { margin-top: 4px; color: var(--ink-2); font-size: 14px; }
.page-actions { display: flex; gap: 12px; }

.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  padding: 10px 0 11px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.tab:hover { text-decoration: none; color: var(--ink); }
.tab.active { margin-bottom: -1px; border-bottom: 2px solid var(--primary); color: var(--primary); font-weight: 600; }
.tab.stub:hover { color: var(--ink-2); }

/* --- Компоненты --- */

.card { background: var(--surface); border-radius: 8px; box-shadow: var(--shadow); }
.card-pad { padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-title { font-size: 14px; font-weight: 600; line-height: 18px; }
.card-link { color: var(--primary); font-size: 12px; font-weight: 500; }
.card-empty { margin-top: 12px; color: var(--ink-3); font-size: 12.5px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn-sm { height: 32px; }
.btn-primary { border-color: var(--primary); background: var(--primary); color: #fff; font-weight: 600; }
.btn-primary:hover { background: #1E4CC4; }
.btn-soft { border-color: transparent; background: var(--primary-soft); color: var(--primary); font-weight: 600; padding: 0 16px; }
.btn-soft:hover { background: #DCE7FD; }
.btn-ghost { border-color: transparent; background: none; color: var(--ink-2); padding: 0 12px; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-block { width: 100%; }
.btn-lg { height: 40px; }
.btn.stub:hover { background: #fff; }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { color: var(--ink-2); font-size: 11.5px; font-weight: 500; }
.field-hint { color: var(--ink-3); font-size: 11.5px; }
.input, .select {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
}
.input-lg { height: 40px; font-size: 14px; }
.select {
  appearance: none;
  padding-right: 30px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238592A8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 15px;
}
.input:focus, .select:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.select:disabled { background-color: #fff; }

.search { position: relative; flex: 1; min-width: 0; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search .input { height: 36px; padding-left: 36px; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 10px; background: var(--bg); color: var(--ink-2); font-size: 12px; font-weight: 500; }
.chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 500;
}

.alert { margin-top: 16px; padding: 10px 12px; border-radius: 6px; background: var(--danger-soft); color: var(--danger); font-size: 13px; }

/* --- Экран «Студенты» --- */

.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.sum { display: flex; align-items: center; gap: 14px; padding: 14px 20px; }
.sum + .sum { border-left: 1px solid var(--line); }
.sum-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0; }
.sum-icon.blue { background: var(--primary-soft); color: var(--primary); }
.sum-icon.violet { background: var(--violet-soft); color: var(--violet); }
.sum-icon.green { background: var(--success-soft); color: var(--success); }
.sum-icon.orange { background: var(--warn-soft); color: var(--warn); }
.sum-label { color: var(--ink-2); font-size: 12px; }
.sum-value { margin-top: 2px; font-size: 20px; font-weight: 700; }
.sum-value .dash { font-weight: 600; }

.body-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 1240px) { .body-grid { grid-template-columns: minmax(0, 1fr); } }

.filters { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.filter-row { display: flex; align-items: center; gap: 8px; }
.filter-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1100px) { .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.quick-label { color: var(--ink-3); font-size: 12px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.toolbar-title { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.toolbar-tools { display: flex; align-items: center; gap: 8px; }
.sort { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink-2); font-size: 12.5px; }
.sort b { color: var(--ink); font-weight: 600; }

.table { width: 100%; border-collapse: collapse; }
.table th {
  height: 37px;
  padding: 0 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.table td { height: 56px; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 16px; }
.table th:last-child, .table td:last-child { padding-right: 16px; }
.table tbody tr:hover td { background: var(--surface-2); }
.th-sort { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.th-sort:hover, .th-sort.active { color: var(--primary); }
.fio + .badge { margin-left: 6px; }
.col-num { width: 26px; color: var(--ink-3); font-size: 12.5px; }
.col-check { width: 28px; }
.col-menu { width: 32px; }
.fio { font-weight: 600; letter-spacing: -.15px; white-space: nowrap; }
.col-dir { width: 190px; }
.col-form { width: 110px; white-space: nowrap; }
.fio-sub { margin-top: 2px; color: var(--ink-3); font-size: 11.5px; }
.cell-strong { font-weight: 500; white-space: nowrap; }
.cell-soft { color: var(--ink-2); font-size: 12.5px; line-height: 16px; }
.table-empty { padding: 32px 16px; color: var(--ink-3); text-align: center; }

/* Отметка о посещении */
.mark { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.mark-ok { background: var(--success-soft); color: var(--success); }
.mark-absent { background: var(--danger-soft); color: var(--danger); }

/* Графики посещаемости: горизонтальные полосы, черта — среднее по выборке */
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .chart-grid { grid-template-columns: minmax(0, 1fr); } }
.card-note { color: var(--ink-3); font-size: 12px; }
.bars { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.bar-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 5px; }
.bar-label { color: var(--ink); font-size: 12.5px; }
.bar-value { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.bar-track { position: relative; height: 6px; border-radius: 3px; background: #EDF0F5; }
.bar-fill { height: 100%; border-radius: 3px; background: currentColor; }
.bar-avg { position: absolute; top: -3px; width: 2px; height: 12px; margin-left: -1px; border-radius: 1px; background: var(--ink); opacity: .55; }

/* Столбики по дням (дашборд «Активность студентов») */
.day-columns { display: flex; align-items: flex-end; gap: 4px; margin-top: 14px; }
.day-col { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.day-col-value { min-height: 15px; color: var(--ink-2); font-size: 11px; font-weight: 600; }
.day-col-track { display: flex; align-items: flex-end; width: 100%; height: 120px; border-radius: 3px; background: #EDF0F5; }
.day-col-fill { width: 100%; border-radius: 3px; background: var(--primary); }
.day-col-off .day-col-fill { background: #AEBAD2; }
.day-col-today .day-col-label { color: var(--primary); font-weight: 700; }
.day-col-label { color: var(--ink-3); font-size: 10.5px; white-space: nowrap; }
.card-more { display: flex; justify-content: center; padding: 8px; border-top: 1px solid var(--line); }

/* Главная: плитки разделов */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; gap: 6px; color: inherit; }
.tile:hover { text-decoration: none; box-shadow: var(--shadow), 0 0 0 1px var(--line-strong); }
.tile-head { display: flex; align-items: center; gap: 10px; color: var(--ink-3); }
.tile-head .sum-icon { width: 30px; height: 30px; }
.tile-title { flex: 1; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.tile-value { margin-top: 4px; font-size: 20px; font-weight: 700; }
.tile-line { color: var(--ink-3); font-size: 12px; }
.section-title { margin-top: 8px; font-size: 18px; font-weight: 700; }
.section-title + .page-subtitle { margin-top: -8px; }

/* Настройки системы */
.settings { display: flex; flex-direction: column; gap: 16px; }
.settings .bells { max-width: 420px; margin-top: 12px; }
.settings .bells .input { width: 110px; }
.settings-fields { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; }
.settings-fields .input { width: 160px; }
.settings-actions { display: flex; justify-content: flex-end; gap: 8px; }
.settings-errors ul { margin: 6px 0 0 18px; }

/* Анкета студента: национальность и ОВЗ */
.survey { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; max-width: 420px; }
.survey fieldset { border: 0; margin: 0; padding: 0; }
.radios { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 4px; }
.radio { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
#survey .notice, #survey .alert { margin-top: 12px; }

/* QR-код аудитории: история и перевыпуск */
.qr-history { margin-top: 12px; }
.danger-zone { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.danger-zone > summary { color: var(--danger); font-size: 13px; font-weight: 600; cursor: pointer; }
.danger-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 12px; }
.danger-form .input { width: 220px; }
.btn-danger { border-color: var(--danger); color: var(--danger); font-weight: 600; }
.btn-danger:hover { background: var(--danger-soft); }
#qr .notice, #qr .alert { margin-top: 12px; }

.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-high { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warn-soft); color: var(--warn); }
.badge-ok { background: var(--success-soft); color: var(--success); }
.badge-muted { background: var(--bg); color: var(--ink-2); }
a.badge:hover { text-decoration: none; }
.nowrap { white-space: nowrap; }
.log-table td { vertical-align: top; padding-top: 10px; padding-bottom: 10px; }
.log-table .badge + .badge, .log-table a + .badge { margin-left: 6px; }
.card-alert { box-shadow: var(--shadow), inset 3px 0 0 var(--danger); }
.sum-sub { color: var(--ink-3); font-size: 11.5px; font-weight: 500; }
.table-compact td { height: 40px; }

/* Сетка расписания */
.timetable { table-layout: fixed; }
.timetable td { height: auto; padding-top: 10px; padding-bottom: 10px; vertical-align: top; border-left: 1px solid var(--line); }
.timetable th + th { border-left: 1px solid var(--line); }
.timetable .tt-pair { width: 112px; border-left: 0; white-space: nowrap; }
.timetable tbody tr:hover td { background: none; }
.timetable .tt-today { background: #F6F9FF; }
.timetable th.tt-today { background: var(--primary-soft); color: var(--primary); }
.lesson { display: flex; flex-direction: column; gap: 4px; }
.lesson-subject { font-weight: 600; line-height: 1.3; }
.lesson-meta { color: var(--ink-2); font-size: 12px; }
.lesson-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.pill-stream { background: var(--violet-soft); color: var(--violet); }
.lesson + .lesson { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line-strong); }
.lesson-sub { color: var(--violet); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }

.checkbox {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  vertical-align: middle;
}

.menu { position: relative; }
.menu > summary {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--ink-3);
  list-style: none;
  cursor: pointer;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover, .menu[open] > summary { background: var(--bg); color: var(--ink); }
.menu-pop {
  position: absolute;
  top: 32px;
  right: 0;
  z-index: 20;
  width: 224px;
  padding: 4px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-pop);
}
.menu-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 5px; color: var(--ink); font-size: 13px; }
.menu-item:hover { background: var(--bg); text-decoration: none; }
.menu-item.stub { opacity: 1; color: var(--line-strong); }
.menu-item.stub:hover { background: none; }
.menu-item.danger { color: var(--danger); font-weight: 500; }
.menu-item.danger.stub { color: #E8A3A6; }
.menu-divider { height: 1px; margin: 4px 0; background: var(--line); }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; color: var(--ink-2); }
.pager { display: flex; align-items: center; gap: 4px; }
.page {
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font-weight: 500;
}
.page:hover { text-decoration: none; background: var(--surface-2); }
.page.current { border-color: var(--primary); background: var(--primary); color: #fff; font-weight: 600; }
.page.disabled { color: var(--line-strong); pointer-events: none; }
.page.gap { border-color: transparent; }
.per-page { display: flex; align-items: center; gap: 8px; }
.per-page .select { width: auto; height: 32px; font-weight: 600; }

.donut-row { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.donut { position: relative; flex-shrink: 0; width: 96px; height: 96px; border-radius: 50%; }
.donut::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: #fff; }
.donut-value { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; font-size: 15px; font-weight: 700; }
.legend { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.swatch { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.legend-label { color: var(--ink-2); font-size: 12px; }
.legend-value { font-size: 12.5px; font-weight: 600; }

/* --- Карточка студента / профиль --- */

.profile { display: grid; grid-template-columns: 200px 1fr; }
.profile dt, .profile dd { margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.profile dt { color: var(--ink-2); }
.profile dd { font-weight: 500; }
.profile > :nth-last-child(-n+2) { border-bottom: 0; }

.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }

/* --- Вход --- */

.auth { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.auth-card { width: min(400px, 100%); padding: 32px; border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.auth-card .brand { padding: 0; margin-bottom: 24px; }
.auth-card .brand-name { color: var(--ink); }
.auth-card .brand-tag { color: var(--ink-3); }
.auth-title { font-size: 20px; font-weight: 700; }
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.auth-foot { margin-top: 20px; color: var(--ink-3); text-align: center; }

/* --- Студент --- */

.student-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 24px;
  background: var(--side-bg);
}
.student-top .topbar-user .user-name { color: #fff; }
.student-top .topbar-user .user-role { color: var(--side-muted); }
.student-content { display: flex; flex-direction: column; gap: 16px; width: min(1080px, 100%); margin: 0 auto; padding: 24px 16px 32px; }
.student-content .alert { margin-top: 0; }
.classmates { margin: 8px 0 0; padding: 0; list-style: none; columns: 2; column-gap: 24px; }
.classmates li { padding: 8px 0; border-bottom: 1px solid var(--line); break-inside: avoid; }

/* Разделы кабинета: на широком экране — вкладки под шапкой, на телефоне — нижнее меню. */
.student-nav { display: flex; justify-content: center; gap: 4px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.student-nav-item { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 2px solid transparent; color: var(--ink-2); font-weight: 500; }
.student-nav-item:hover { color: var(--ink); }
.student-nav-item.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Пары дня — список «время | пара». */
.day-list { display: flex; flex-direction: column; margin: 8px 0 0; padding: 0; list-style: none; }
.day-pair { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.day-pair:first-child { border-top: 0; }
.day-list > .card-empty { padding: 4px 0; }
.day-today { box-shadow: var(--shadow), inset 3px 0 0 var(--primary); }
.attendance-teaser { display: block; color: inherit; }
.attendance-teaser:hover { box-shadow: var(--shadow), 0 0 0 1px var(--line-strong); }
.only-narrow { display: none; }
.absences .day-pair { grid-template-columns: 112px minmax(0, 1fr); }
.scan-ok { box-shadow: var(--shadow), inset 3px 0 0 var(--success); }
.scan-fail { box-shadow: var(--shadow), inset 3px 0 0 var(--danger); }
.scan-result .alert { margin-top: 12px; }
.scan-message { margin-top: 8px; font-weight: 600; }
.scan-lesson { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

@media (max-width: 640px) {
  .classmates { columns: 1; }
  .profile { grid-template-columns: 1fr; }
  .profile dt { padding-bottom: 0; border-bottom: 0; }
  .student-top { height: 56px; padding: 0 12px; }
  .student-top .brand-tag, .student-who { display: none; }
  .student-content { padding: 16px 12px calc(84px + env(safe-area-inset-bottom)); }
  .student-nav {
    position: fixed; inset: auto 0 0 0; z-index: 20; justify-content: space-around; gap: 0; padding: 0 0 env(safe-area-inset-bottom);
    border-top: 1px solid var(--line); border-bottom: 0; box-shadow: 0 -2px 12px rgba(16, 24, 40, .06);
  }
  .student-nav-item { flex: 1; flex-direction: column; gap: 2px; padding: 8px 4px 10px; border-bottom: 0; font-size: 11px; }
  .student-nav-item.active { border-top: 2px solid var(--primary); padding-top: 6px; }
  .only-narrow { display: flex; }
  .only-wide { display: none; }
  .summary .sum + .sum { border-left: 0; border-top: 1px solid var(--line); }
}

/* --- Аудитории и QR-коды --- */

.notice { padding: 10px 12px; border-radius: 6px; background: var(--success-soft); color: var(--success); font-size: 13px; }
.room-actions { display: flex; justify-content: flex-end; gap: 8px; }
.room-actions form { margin: 0; }

.qr-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.qr-sheet { display: flex; flex-direction: column; align-items: center; gap: 16px; min-height: 100vh; padding: 48px 24px; text-align: center; }
.qr-room { font-size: 44px; font-weight: 700; }
.qr-code { width: min(120mm, 80vw); }
.qr-code svg { display: block; width: 100%; height: auto; }
.qr-caption { font-size: 22px; font-weight: 600; }
.qr-hint { max-width: 140mm; color: var(--ink-2); font-size: 15px; line-height: 1.4; }
.qr-mark { margin-top: 8px; color: var(--ink-3); font-size: 12px; letter-spacing: .2px; }
.qr-toolbar-alert { margin: 12px 24px 0; }

@media print {
  .qr-toolbar, .qr-toolbar-alert { display: none; }
  .qr-sheet { min-height: auto; padding: 20mm 10mm 0; break-after: page; }
  .qr-sheet:last-child { break-after: auto; }
}
