/* Электронная ведомость — стили. Без внешних шрифтов и CDN: работает в закрытом контуре.
   Оформление — по сайту кафедры (med.spbu.ru/kafedra-gospitalnoj-terapii): бирюзовый акцент #0096A5,
   заголовки прописными с короткой бирюзовой чертой, геометрический гротеск (Manrope, OFL — свой шрифт сайта
   EuclidCircularB лицензионный и не встраивается). */
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/manrope-cyrillic-400-normal.7d1637a696b6.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/manrope-latin-400-normal.1589a53d0b0e.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/manrope-cyrillic-600-normal.3470ad06386c.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/manrope-latin-600-normal.58d382c3e448.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/manrope-cyrillic-700-normal.b3aed8e4cd3a.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/manrope-latin-700-normal.ed9e261b92db.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --ink: #1a1a1a; --muted: #666666; --line: #e1e7ea; --bg: #f7f9fa; --card: #fff;
  --accent: #0096a5; --accent-dark: #007a87; --accent-soft: #e4f4f6;
  --present: #ffffff; --absent: #f7c7c0; --absent-ink: #8a1c10;
  --excused: #fde3a7; --excused-ink: #7a4b00; --worked: #cdebd3; --worked-ink: #1d5e2e;
  --emptypast: #fff6cc; --ok: #1d7a3a; --warn: #b26a00; --bad: #b42318;
  --lect: #f3f5fb;
  font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "EuclidCircularB", "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font-family: inherit; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
.muted { color: var(--muted); margin: 2px 0; } .small { font-size: 12px; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }

.env-banner { background: repeating-linear-gradient(45deg, #b26a00, #b26a00 12px, #c98a20 12px, #c98a20 24px); color: #fff; text-align: center; font-weight: 600; padding: 4px; font-size: 12px; letter-spacing: .03em; }
.env-development .env-banner { background: #475467; }

/* шапка в две строки, как на сайте кафедры: бренд и пользователь, ниже — ряд вкладок */
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 28px; padding: 10px 24px 0; background: var(--card); border-bottom: 3px solid var(--accent); position: sticky; top: 0; z-index: 30; }
.brand { display: flex; gap: 10px; align-items: center; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { background: var(--accent); color: #fff; font-weight: 700; border-radius: 5px; padding: 6px 7px; font-size: 12px; letter-spacing: .05em; }
.brand b { display: block; font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .01em; }
.brand small { color: var(--muted); font-size: 11px; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; order: 3; flex-basis: 100%; padding: 4px 0 8px; }
.topbar:not(:has(.nav)) { padding-bottom: 10px; }
.nav a { color: var(--accent); padding: 6px 11px; border-radius: 5px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.nav a:hover { background: var(--accent-soft); text-decoration: none; }
.nav a.active { background: var(--accent); color: #fff; text-decoration: none; }
.user { display: flex; gap: 14px; align-items: center; font-size: 13px; }
.user form { margin: 0; }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }

.page { padding: 20px 24px 40px; max-width: 100%; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
h1 { font-size: 22px; font-weight: 700; text-transform: uppercase; letter-spacing: .01em; margin: 0 0 6px; color: var(--ink); }
.pagehead h1::after { content: ""; display: block; width: 100px; height: 3px; background: var(--accent); margin-top: 8px; }
h2 { font-size: 18px; font-weight: 600; color: var(--accent); margin: 22px 0 10px; }
h3 { font-weight: 600; }
.crumbs { margin: 0 0 4px; font-size: 12px; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-block; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 7px 12px; border-radius: 5px; cursor: pointer; font: inherit; font-weight: 600; }
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.flash { background: var(--accent-soft); border: 1px solid #b6e0e5; padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; }
.flash.warn { background: #fff6e5; border-color: #f5d49a; }
.empty { color: var(--muted); padding: 24px; text-align: center; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 6px 0 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; position: relative; }
.kpi::before { content: ""; position: absolute; left: 12px; top: 0; width: 32px; height: 3px; background: var(--accent); border-radius: 0 0 2px 2px; }
.kpi span { display: block; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); }
.sortbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pill { text-decoration: none !important; color: var(--ink); }
.pill.on { color: #fff; }
table.dash td { vertical-align: middle; }
table.dash th.sortable a { color: var(--ink); display: inline-flex; gap: 4px; align-items: center; }
table.dash th.sortable .arrow { color: #98a2b3; font-size: 11px; }
table.dash th.sorted a, table.dash th.sorted .arrow { color: var(--accent); }
table.dash tr.rowlink { cursor: pointer; }
table.dash tr.rowlink:hover td { background: var(--accent-soft); }
table.dash .barcol { width: 140px; }
table.dash .bar { margin: 0; }
.nowrap { white-space: nowrap; }
.list td.ok { color: var(--ok); font-weight: 600; } .list td.bad { color: var(--bad); font-weight: 600; }
.kpi.ok span { color: var(--ok); } .kpi.bad span { color: var(--bad); } .kpi.warn span { color: var(--warn); }
.kpis.compact .kpi { padding: 6px 10px; } .kpis.compact .kpi span { font-size: 18px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; color: var(--ink); display: flex; flex-direction: column; gap: 5px; }
.card:hover { border-color: var(--accent); text-decoration: none; box-shadow: 0 2px 8px rgba(16,24,40,.06); }
.card-top { display: flex; align-items: center; gap: 8px; }
.grp { font-size: 18px; }
.tag { background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 2px 7px; font-size: 12px; }
.tag.locked { background: #eceff3; color: var(--muted); }
.bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: #eceff3; margin-top: 6px; }
.b-auto { background: var(--ok); } .b-retake { background: var(--bad); } .b-und { background: #c4c9d2; }
.card-stats { display: flex; gap: 10px; flex-wrap: wrap; }

.legend { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; color: var(--muted); }
.chip { display: inline-block; min-width: 22px; text-align: center; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); font-size: 12px; margin: 1px 2px; color: var(--ink); }

.tablewrap { overflow: auto; max-height: calc(100vh - 330px); border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
table.jt { border-collapse: separate; border-spacing: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.jt th, .jt td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0 5px; height: 30px; white-space: nowrap; background: var(--card); }
.jt thead th { position: sticky; top: 0; z-index: 3; background: var(--accent-soft); color: #0b4f57; font-weight: 600; font-size: 12px; text-align: center; }
.jt thead tr:nth-child(2) th { top: 92px; font-weight: 400; color: var(--muted); }
.jt thead tr:first-child th { height: 92px; vertical-align: bottom; }
.jt th.les { position: sticky; width: 80px; min-width: 80px; max-width: 80px; white-space: normal; text-align: left; padding: 4px 5px; vertical-align: top; }
.jt th.les .lkind { display: block; font-size: 10px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.jt th.les .ltitle { font-size: 11px !important; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; font-size: 11.5px; line-height: 1.25; font-weight: 600; color: var(--ink); }
.jt th.les.notopic .ltitle { color: var(--muted); font-style: italic; }
.jt th.les:has(.topicsel):hover { background: var(--accent-soft); cursor: pointer; }
.jt th.les:has(.topicsel):hover .ltitle { color: var(--accent); text-decoration: underline dotted; }
.jt th.les .topicsel { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 13px; }
.jt th.les .topicsel:focus-visible + * , .jt th.les:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; }
.jt th.lect, .jt td.lect { background: var(--lect); }
.jt th.today { color: var(--accent); font-weight: 700; }
.jt .sticky { position: sticky; z-index: 2; }
.jt thead .sticky { z-index: 4; }
.jt .c-n { left: 0; width: 34px; min-width: 34px; text-align: right; color: var(--muted); }
.jt .c-name { left: 34px; min-width: 190px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; text-align: left; box-shadow: 1px 0 0 var(--line); }
.jt th.calc { background: #eef1f6; } .jt th.calc-in { background: #f7eef0; }
.jt td.num { text-align: center; min-width: 36px; }
.jt th.flagh { white-space: normal; width: 58px; min-width: 58px; line-height: 1.1; }
.jt td.res, .jt th.c-res { min-width: 140px; max-width: 150px; width: 146px; font-weight: 600; white-space: normal; line-height: 1.2; }
.jt .res-now { position: sticky; right: 0; z-index: 2; box-shadow: -6px 0 8px -6px rgba(16,24,40,.25); }
.jt thead .res-now { z-index: 4; }
.jt td.res .after { display: block; font-size: 11px; font-weight: 500; color: var(--ok); margin-top: 1px; }
.jt.compact .calc-col { display: none; }
.jt td.c-name { overflow: visible; }
.jt td.c-name:has(details[open]) { z-index: 8; }
.who summary { list-style: none; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who summary::-webkit-details-marker { display: none; }
.who summary:hover { color: var(--accent); text-decoration: underline dotted; }
.who[open] summary { color: var(--accent); }
.who .pop { position: absolute; z-index: 10; margin-top: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(16,24,40,.12); padding: 8px 10px; font-size: 12px; color: var(--muted); }
.who .pop select { display: block; margin-top: 4px; font: inherit; font-size: 13px; padding: 4px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); }
.stbadge { font-size: 10.5px; background: #eceff3; color: var(--muted); border-radius: 4px; padding: 1px 5px; margin-left: 4px; font-weight: 500; }
#calcToggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.jt tr.inactive td { color: #98a2b3; background: #fafafa; }
.jt tbody tr:hover td { background-image: linear-gradient(rgba(0,150,165,.05), rgba(0,150,165,.05)); }
.jt tfoot td { background: #f9fafb; color: var(--muted); font-size: 12px; }

.jt td.mc { padding: 0; min-width: 38px; width: 80px; text-align: center; }
.jt td.mc select, .jt td.kr select { width: 100%; height: 29px; border: 0; background: transparent; text-align: center; text-align-last: center; font: inherit; font-weight: 600; cursor: pointer; -webkit-appearance: none; appearance: none; padding: 0 4px; color: inherit; }
.jt td.mc select:focus, .jt td.kr select:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.jt td.kr { padding: 0; min-width: 44px; background: #fdf8f9; }
.jt td.flag { text-align: center; }
.m-absent { background: var(--absent) !important; color: var(--absent-ink); }
.m-excused { background: var(--excused) !important; color: var(--excused-ink); }
.m-worked { background: var(--worked) !important; color: var(--worked-ink); }
.m-emptypast { background: var(--emptypast) !important; }
.chip.m-present { background: #fff; }
.risk-warn { background: #fde7b0 !important; color: #7a4b00; font-weight: 600; }
.risk-high { background: #f7c7c0 !important; color: var(--absent-ink); font-weight: 700; }
td.warnc { background: var(--emptypast) !important; color: var(--warn); font-weight: 600; }
.r-auto { color: var(--ok); } .r-retake { color: var(--bad); } .r-exam { color: var(--accent); } .r-na { color: #98a2b3; }
.htmx-request td { opacity: .6; }

table.list { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 13px; }
.list th { text-align: left; background: var(--accent-soft); color: #0b4f57; font-weight: 600; font-size: 12px; padding: 8px; border-bottom: 1px solid var(--line); }
.list td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.list .num { text-align: center; } .list .res { font-weight: 600; }
.list tr.inactive td { color: #98a2b3; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.filters select { padding: 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.pill { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px; cursor: pointer; font: inherit; }
.pill.on { background: var(--accent); color: #fff; border-color: var(--accent); }

.login { max-width: 380px; margin: 60px auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.login label { display: block; margin: 12px 0; font-size: 13px; color: var(--muted); }
.login input { display: block; width: 100%; padding: 9px; margin-top: 4px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.login .btn { width: 100%; margin-top: 8px; padding: 10px; }
.err { color: var(--bad); background: #fdecea; padding: 8px; border-radius: 6px; }
.foot { color: var(--muted); font-size: 11px; padding: 10px 24px; }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--bad); color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.15); z-index: 50; }

@media print {
  .topbar, .env-banner, .actions, .foot, .legend + .tablewrap::before, .kpis, .nav { display: none !important; }
  body { background: #fff; } .page { padding: 0; }
  .tablewrap { max-height: none; overflow: visible; border: 0; }
  .jt th, .jt td { position: static !important; font-size: 10px; height: auto; padding: 2px 4px; }
  .jt select { -webkit-appearance: none; border: 0; }
  @page { size: A4 landscape; margin: 10mm; }
}

/* ---------- ФИО, кодовая фраза (v0.4.0) ---------- */
.fio { font-variant-numeric: tabular-nums; }
.fio:not(.decrypted) { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.fio.broken { color: var(--bad); }
.fiostate { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.fiostate[data-state="open"] { border-color: #b7dfc2; background: #eef8f0; color: var(--ok); }
.fiostate[data-state="closed"] { border-color: #f5d49a; background: #fff8ea; color: var(--warn); }
.dlg { border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; width: min(480px, 92vw); box-shadow: 0 20px 50px rgba(16,24,40,.25); }
.dlg::backdrop { background: rgba(16,24,40,.45); }
.dlg h2 { margin: 0 0 6px; font-size: 18px; }
.dlg input[type=password], .dlg input[type=text], .dlg input[name=fio] { width: 100%; padding: 9px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.dlg .err { color: var(--bad); background: #fdecea; padding: 6px 8px; border-radius: 6px; }
.dlg-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; }
.passrow { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.passrow input { flex: 1; }
label.check { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; margin: 8px 0; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.panel.narrow { max-width: 640px; }
.panel h2 { font-size: 16px; margin: 0 0 8px; }
/* аккордеоны и блоки «details» — как на сайте кафедры: бирюзовый заголовок и «+» справа */
details.panel > summary { cursor: pointer; color: var(--accent); font-weight: 600; list-style: none; position: relative; padding-right: 22px; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: "+"; position: absolute; right: 2px; top: 50%; transform: translateY(-50%); font-size: 20px; font-weight: 400; color: var(--accent); }
details.panel[open] > summary::after { content: "×"; }
.panel form label { display: block; font-size: 13px; color: var(--muted); margin: 8px 0; }
.panel form input:not([type=checkbox]), .panel form select { font: inherit; padding: 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { margin: 0 !important; display: flex !important; flex-direction: column; gap: 4px; }
.inline-form .grow { flex: 1; min-width: 260px; }
.inline-form .grow input { width: 100%; }
.msg { padding: 6px 10px; border-radius: 6px; font-size: 13px; width: 100%; }
.msg.ok { background: #eef8f0; color: var(--ok); }
.msg.bad { background: #fdecea; color: var(--bad); }
.namefilter { padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; font: inherit; min-width: 220px; margin-right: 8px; }
.small-table { max-height: 320px; margin: 10px 0; }
tr.err-row td { background: #fdecea; }
select.saved { outline: 2px solid var(--ok); }
table.kv th { width: 200px; }
button:disabled { opacity: .55; cursor: not-allowed; }

[hidden] { display: none !important; }
.nav a, .brand b, .brand small { white-space: nowrap; }
.topbar { gap: 20px; }
.user .role { display: none; }

.issues { color: var(--bad); font-size: 13px; margin: 6px 0; padding-left: 18px; max-height: 240px; overflow: auto; }
td.warncell { color: var(--warn); font-size: 12px; max-width: 360px; }
.inline-form label[hidden] { display: none !important; }

.groupnav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.groupnav .btn { padding: 5px 10px; font-size: 13px; }
.groupnav .btn.back { font-weight: 600; }
.groupsel select { font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media print { .groupnav { display: none !important; } }

.viewas-banner { background: #fff3c4; border-bottom: 2px solid #e0b000; color: #5c4400; padding: 6px 24px; display: flex; gap: 14px; align-items: center; justify-content: center; font-size: 13px; }
.viewas-banner form { margin: 0; }
.viewas-banner .btn { padding: 4px 10px; font-size: 12px; background: #fff; }
.viewas-form { margin: 0; }
.viewas-form select { font: inherit; font-size: 12px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); max-width: 170px; }
@media print { .viewas-banner { display: none !important; } }

/* статус группы на рабочем столе (v0.6.1) */
.stbadge2 { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; border: 1px solid transparent; }
.stbadge2.st-active { background: #e8f1fe; color: #1f5fbf; border-color: #c5dafc; }
.stbadge2.st-planned { background: #f2f4f7; color: #475467; border-color: #e3e6eb; }
.stbadge2.st-finished { background: #fff6e5; color: #9a5b00; border-color: #f5d49a; }
.stbadge2.st-attested { background: #eef8f0; color: var(--ok); border-color: #c6e6cf; }
.stbadge2.st-locked { background: #eceff3; color: var(--muted); }
.stbadge2.st-nodates { background: #fdecea; color: var(--bad); }
.patype { font-weight: 600; }
.patype.pa-exam { color: var(--accent); }
table.dash tr.st-attested td, table.dash tr.st-locked td { color: #7a8494; }

/* шапка не должна вылезать за экран у завуча (много пунктов меню) */
.topbar { gap: 14px; }
.nav { flex-wrap: nowrap; min-width: 0; }
.nav a { padding: 7px 9px; }
.user { gap: 10px; white-space: nowrap; }
.viewas-form select { max-width: 150px; }
@media (max-width: 1560px) { .brand small { display: none; } .user > span[title] { display: none; } }

/* v0.7: занятия, проведённые аспирантом */
.jt th.bypg, .jt td.bypg { background-image: linear-gradient(rgba(124, 58, 237, .07), rgba(124, 58, 237, .07)); }
.jt th.les.bypg { box-shadow: inset 0 3px 0 #7c3aed; }
.jt tr.condrow th { font-weight: 400; font-size: 11px; padding: 2px 3px; white-space: nowrap; }
.condsel { font-size: 11px; padding: 1px 2px; max-width: 92px; border: 1px solid var(--line, #d0d5dd); border-radius: 4px; background: #fff; }
.pgtag, .chip.bypg { display: inline-block; font-size: 11px; color: #5b21b6; background: #ede9fe; border-radius: 4px; padding: 0 5px; }
button.claim { font-size: 11px; padding: 1px 6px; border: 1px dashed #7c3aed; color: #5b21b6; background: #fff; border-radius: 4px; cursor: pointer; }
button.claim:hover { background: #ede9fe; }
button.unclaim { font-size: 11px; border: 0; background: none; color: #9ca3af; cursor: pointer; padding: 0 2px; }
@media print { .condsel, button.claim, button.unclaim { display: none; } }

/* v0.8: результат ПА в сводке — серым прогноз по БРС, чётким цветом — выставленная оценка */
td.pa { white-space: nowrap; }
.paforecast { color: #9ca3af; font-style: italic; font-size: 12px; }
.pasel { font-size: 12px; padding: 2px 4px; border: 1px solid var(--line, #d0d5dd); border-radius: 5px; background: #fff; color: #6b7280; max-width: 150px; }
.pasel + .paforecast { margin-left: 6px; }
.pares { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 12px; font-weight: 600; }
.pa-5, .pa-pass { background: #dcfce7; color: #166534; border-color: #86efac; font-weight: 600; }
.pa-4 { background: #ecfccb; color: #3f6212; border-color: #bef264; font-weight: 600; }
.pa-3 { background: #fef3c7; color: #92400e; border-color: #fcd34d; font-weight: 600; }
.pa-2, .pa-fail { background: #fee2e2; color: #991b1b; border-color: #fca5a5; font-weight: 600; }
.pa-absent { background: #e5e7eb; color: #374151; border-color: #9ca3af; font-weight: 600; }
.pawarn { color: #b45309; margin-left: 4px; cursor: help; }
@media print { .pasel { border: 0; appearance: none; } }

/* v0.9: семестры */
.term-form select { font-size: 13px; padding: 5px 8px; border: 1px solid var(--line, #d0d5dd); border-radius: 8px; background: #fff; max-width: 190px; }
.jt td.prior { font-size: 12px; white-space: nowrap; text-align: center; background: #f8fafc; }
.jt td.prior .pu { color: #475569; }
.admit { display: block; font-size: 11px; color: #b91c1c; }
.admit.pending { color: #b45309; }

.navmore { position: relative; }
.navmore > summary { list-style: none; cursor: pointer; padding: 6px 11px; border-radius: 5px; color: var(--accent); white-space: nowrap; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.navmore > summary::-webkit-details-marker { display: none; }
.navmore[open] > summary { background: var(--accent-soft); color: var(--accent); }
.navmore.active > summary { background: var(--accent); color: #fff; }
.navmenu { position: absolute; top: 100%; left: 0; z-index: 50; margin-top: 4px; min-width: 200px; background: #fff; border: 1px solid var(--line, #d0d5dd); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; display: flex; flex-direction: column; }
.navmenu a { padding: 8px 10px; border-radius: 6px; white-space: nowrap; }
.navmenu a:hover, .navmenu a.active { background: var(--accent-soft, #fbe9ec); }
.jt td.prior .pk { display: block; color: #334155; }
label.check { display: inline-flex; align-items: center; gap: 6px; flex-direction: row; }

/* v0.10: график кафедры */
.sgridwrap { max-height: 72vh; overflow: auto; }
.sgrid { border-collapse: separate; border-spacing: 0; font-size: 11px; table-layout: fixed; }
.sgrid th, .sgrid td { border-right: 1px solid #eef0f3; border-bottom: 1px solid #eef0f3; padding: 0; height: 24px; }
.sgrid thead th { position: sticky; top: 0; background: #f8fafc; z-index: 2; font-weight: 500; color: #475569; }
.sgrid thead tr:nth-child(2) th { top: 22px; }
.sgrid thead tr:nth-child(3) th { top: 44px; }
.sgrid .sg-month { text-align: left; padding-left: 6px; font-weight: 600; text-transform: capitalize; border-left: 2px solid #cbd5e1; }
.sgrid .sg-d, .sgrid .sg-w, .sgrid .sg-e { width: 24px; min-width: 24px; max-width: 24px; text-align: center; }
.sgrid .sun { background: #f1f5f9; }
.sgrid th.today { background: #fde68a; color: #92400e; }
.sgrid .sg-g { left: 0; z-index: 3; background: #fff; min-width: 92px; width: 92px; text-align: left; padding: 0 6px; font-weight: 600; white-space: nowrap; }
.sgrid thead .sg-g { z-index: 4; }
.sgrid .sg-course th, .sgrid .sg-course td { background: #f1f5f9; font-size: 11px; color: #334155; height: 20px; }
.sgrid td.blk { padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 0; border-radius: 5px; border: 1px solid rgba(0,0,0,.08); }
.sgrid td.blk a { color: #1f2937; text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; }
.sgrid td.blk:hover { filter: brightness(.95); }
.sgrid td.blk.conflict { outline: 2px solid #dc2626; outline-offset: -2px; }
.sgrid td.blk.now { box-shadow: inset 0 -3px 0 #2563eb; }
.sgrid td.lec { background: #ede9fe; color: #5b21b6; font-size: 9px; font-weight: 600; }
.addblk { display: inline-block; margin-left: 4px; color: #64748b; text-decoration: none; font-weight: 400; }
.addblk:hover { color: var(--accent, #8b1a2b); }
.c0 { background: #dbeafe; } .c1 { background: #fde2c4; } .c2 { background: #d9ead3; } .c3 { background: #fbd5d5; }
.c4 { background: #e6d9f2; } .c5 { background: #fff2cc; } .c6 { background: #d0e0e3; } .c7 { background: #ead1dc; }
.c8 { background: #ccfbf1; } .c9 { background: #fce4d6; }
.chip.sun { background: #f1f5f9; border: 1px solid #e2e8f0; }
.conflicts { border-color: #fecaca; }
.conflicts ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.ckind { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 4px; background: #fee2e2; color: #991b1b; margin-right: 4px; }
.ck-teacher { background: #ffedd5; color: #9a3412; }
.flash.ok { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.stack-form label { display: block; margin: 8px 0; }
.stack-form input[type=date], .stack-form select, .stack-form input[type=text] { display: block; margin-top: 3px; padding: 6px 8px; border: 1px solid var(--line, #d0d5dd); border-radius: 6px; min-width: 260px; }
.btn.danger { color: #b91c1c; border-color: #fecaca; }
tr.bad-row td { background: #fef2f2; }
@media print { .sgridwrap { max-height: none; overflow: visible; } }
.sgrid .sg-w { font-size: 9px; color: #94a3b8; }

/* v0.11: дашборд сводки и «Мои задачи» */
.tabs { display: flex; gap: 4px; align-items: center; border-bottom: 1px solid var(--line, #e2e8f0); margin-bottom: 14px; flex-wrap: wrap; }
.tabs .tab { padding: 8px 14px; border-radius: 8px 8px 0 0; color: #475569; text-decoration: none; border: 1px solid transparent; border-bottom: 0; }
.tabs .tab.on { background: #fff; border-color: var(--line, #e2e8f0); color: var(--accent, #8b1a2b); font-weight: 600; margin-bottom: -1px; }
.tabs-note { margin-left: auto; }
a.kpi { text-decoration: none; color: inherit; }
a.kpi:hover { border-color: var(--accent, #8b1a2b); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(520px, 1fr)); gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.grid4 h3 { font-size: 13px; margin: 0 0 6px; }
.grid4 ul { margin: 0; padding-left: 16px; font-size: 13px; }
.mytasks { border-left: 4px solid var(--accent, #8b1a2b); }
.badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 9px; background: #e2e8f0; font-size: 11px; text-align: center; }
.badge.warn { background: #fef3c7; color: #92400e; }
p.ok, .ok.small { color: #047857; }
.pamatrix th:first-child { text-align: left; white-space: nowrap; }
.pamatrix td.hit { background: #eff6ff; font-weight: 600; }
.wo-grades { display: flex; gap: 10px; margin: 12px 0; }
.wo-grades .btn { min-width: 52px; font-size: 18px; font-weight: 600; }
/* педнагрузка */
.loadimport { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 14px; }
.loadimport label { display: flex; gap: 10px; align-items: center; }
table.loadsum td, table.loadsum th { white-space: nowrap; }
table.loadsum td.ud { white-space: normal; min-width: 140px; }
table.loadsum .cellin { width: 64px; text-align: right; }
table.loadsum .cellin.wide { width: 220px; text-align: left; }
table.loadsum tr.over td.tot { color: var(--warn); font-weight: 700; }
table.loadsum tr.under td.tot { color: var(--bad); font-weight: 700; }
table.loadsum td.diff { font-variant-numeric: tabular-nums; }
table.loadlines form.inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 2px 0; }
.addstaff { margin: 8px 0; }
table[data-sortable] thead th:not(.nosort) { cursor: pointer; user-select: none; }
table[data-sortable] thead th:not(.nosort):hover { color: var(--accent); }
table[data-sortable] thead th[aria-sort="ascending"]::after { content: " ▲"; font-size: 10px; color: var(--accent); }
table[data-sortable] thead th[aria-sort="descending"]::after { content: " ▼"; font-size: 10px; color: var(--accent); }
table.loadsum tfoot th { background: #f6f7f9; }
table.loadsum td.act { width: 1%; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }

/* v0.20: «ваши занятия» в ведомости группы, инструменты ведомости лекций */
.jt th.les.mine { box-shadow: inset 0 -4px 0 var(--accent); }
.jt th.date.mine { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; }
.jt th.notmine, .jt td.notmine { opacity: .45; }
.jt td.notmine select { pointer-events: auto; }
.jt.onlymine .notmine { display: none; }
.chip.mine { background: var(--accent-soft); border-bottom: 3px solid var(--accent); }
.chip.notmine { opacity: .45; }
.jt th.les .markall { display: block; margin-top: 4px; width: 100%; font: inherit; font-size: 11px; padding: 2px 3px; border: 1px solid var(--accent); border-radius: 5px; background: var(--card); color: var(--accent-dark); cursor: pointer; }
.jt th.les .markall:hover { background: var(--accent-soft); }
.lecttools { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.lecttools .printone { display: inline-flex; gap: 6px; align-items: center; }
.lecttools select { font: inherit; font-size: 12px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; }
.printonly { display: none; }
@media print {
  .printonly { display: block; }
  .noprint, .lecttools, .namefilter, .legend { display: none !important; }
  .jt .pskip { display: none !important; }
  .lectprint h2 { font-size: 14px; margin: 0 0 4px; } .lectprint p { margin: 0 0 6px; font-size: 12px; }
  .jt.onlymine .notmine { display: none !important; }
}
.mytasks .grid2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.mytasks h3 { font-size: 13px; margin: 0 0 6px; }
.mytasks ul { margin: 0; padding-left: 16px; font-size: 13px; }
.mytasks li { margin: 3px 0; }
.tkind { display: inline-block; font-size: 11px; border-radius: 999px; padding: 0 7px; background: #f2f4f7; color: #475467; }
.tkind.tk-L { background: var(--lect); color: #3b4a8a; border: 1px solid #d5dbf0; }
.tkind.tk-PA { background: #fdecea; color: var(--bad); }
.blockh { font-size: 17px; margin: 18px 0 2px; }
.lecturejt th.les { width: 116px; min-width: 116px; max-width: 116px; text-align: center; }
.lecturejt th.les small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lecturejt th.les small.lecturer { color: var(--ink); }
.lecturejt td.mc { min-width: 116px; }
.jt th.les.mine { background: var(--accent-soft); }
.chip.notmine { opacity: 1; background: #eef0f2; color: #9aa1a8; }
.lecturejt th.les .ltopic { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; font-size: 11.5px; line-height: 1.25; font-weight: 600; color: var(--ink); text-align: left; margin-bottom: 2px; }
.lecturejt th.les { width: 140px; min-width: 140px; max-width: 140px; }
.lecturejt td.mc { min-width: 140px; }
.jt th.les .printlect { display: block; margin-top: 3px; width: 100%; font: inherit; font-size: 11px; padding: 2px 3px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); color: var(--ink); cursor: pointer; }
.jt th.les .printlect:hover { background: var(--bg); }
.jt th .krh { display: block; font-size: 10.5px; line-height: 1.2; white-space: normal; min-width: 74px; }
.lecturejt th.les .topicsel { position: static; opacity: 1; width: 100%; height: auto; margin-top: 3px; font: inherit; font-size: 11px; padding: 1px 2px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); color: var(--ink); }
