/* Eduxa – arkusz stylów. Jasny, spokojny wygląd z jednym kolorem akcentu. */
:root {
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --border: #E3E6EB;
  --border-soft: #EEF0F3;
  --input: #D5DAE1;
  --ink: #1B2433;
  --muted: #5B6474;
  --accent: #2F5D8C;
  --accent-dark: #1F4166;
  --accent-soft: #E8EFF7;
  --accent-softer: #F2F6FB;
  --warn-bg: #FFF4E0;
  --warn-ink: #7A4700;
  --ok-bg: #E6F4EA;
  --ok-ink: #1E5B32;
  --err-bg: #FDECEC;
  --err-ink: #8A1F1F;
  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; line-height: 1.5;
}
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
h2 { margin: 0 0 12px; font-size: 17px; font-weight: 600; }
h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

/* układ */
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand-year { color: var(--muted); font-size: 13px; margin-left: 6px; }
.userbox { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; text-decoration: none;
}
.layout { display: flex; flex-wrap: wrap; min-height: calc(100vh - 59px); }
.sidenav { flex: 1 1 200px; max-width: 100%; padding: 20px 12px; display: flex; flex-direction: column; gap: 2px; }
.sidenav a {
  display: block; padding: 10px 12px; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); font-size: 14px;
}
.sidenav a:hover { background: var(--border-soft); }
.sidenav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.content { flex: 999 1 560px; min-width: 0; padding: 24px 28px 48px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 780px) {
  .sidenav { flex-direction: row; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .content { padding: 18px 16px 40px; }
  .topbar { padding: 10px 16px; }
}

/* karty i siatki */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.card + .card { margin-top: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.cols > .main { flex: 999 1 520px; min-width: 0; }
.cols > .side { flex: 1 1 280px; min-width: 0; }
.stat { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 24px; font-size: 14px; }
.facts dt { color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.facts dd { margin: 0; font-weight: 500; }
.stack > * + * { margin-top: 12px; }

/* tabele */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.list td { padding: 11px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
table.list tr:last-child td { border-bottom: none; }
table.list tr:hover td { background: #FAFBFC; }
table.list a.row-link { color: var(--ink); text-decoration: none; font-weight: 500; }
table.list a.row-link:hover { color: var(--accent); text-decoration: underline; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* plakietki */
.badge { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--border-soft); color: #3F4756; white-space: nowrap; }
.badge.t-S { background: #E8EFF7; color: #24496F; }
.badge.t-H { background: #F3EEFA; color: #553C7B; }
.badge.t-O { background: #E3F4F3; color: #0B5856; }
.badge.t-D { background: #FFF4E0; color: #7A4700; }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge.err { background: var(--err-bg); color: var(--err-ink); }

/* przyciski */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--input); background: var(--surface); color: var(--ink); border-radius: var(--radius-sm);
  font: inherit; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #B9C0CA; color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn.danger { color: var(--err-ink); border-color: #E7B9B9; }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn.link { border: none; background: none; color: var(--accent); padding: 0; min-height: auto; }
form.inline { display: inline; }

/* formularze */
.form { display: flex; flex-direction: column; gap: 16px; max-width: 720px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 20px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.field > label { font-weight: 500; }
.field .help { color: var(--muted); font-size: 12px; }
.field .errors { color: var(--err-ink); font-size: 13px; margin: 0; padding: 0; list-style: none; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search],
input[type=tel], input:not([type]), select, textarea {
  font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--input); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); width: 100%; min-height: 40px;
}
input[type=color] { width: 64px; height: 40px; padding: 2px; border: 1px solid var(--input); border-radius: var(--radius-sm); background: #fff; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; }
.checks { display: flex; flex-direction: column; gap: 6px; }
.checks.row { flex-direction: row; flex-wrap: wrap; gap: 6px 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.filters .field { min-width: 160px; }
.form-errors { background: var(--err-bg); color: var(--err-ink); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; }

/* komunikaty */
.messages { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 8px; }
.messages li { padding: 11px 14px; border-radius: var(--radius-sm); font-size: 14px; background: var(--accent-softer); border: 1px solid #C9D8EA; }
.messages li.success { background: var(--ok-bg); border-color: #B7DCC2; color: var(--ok-ink); }
.messages li.error { background: var(--err-bg); border-color: #F0C2C2; color: var(--err-ink); }
.messages li.warning { background: var(--warn-bg); border-color: #E9C98F; color: var(--warn-ink); }

/* macierz uprawnień */
table.matrix th.role { writing-mode: vertical-rl; transform: rotate(180deg); text-align: left; padding: 10px 6px; font-weight: 600; height: 150px; }
table.matrix td.c { text-align: center; padding: 8px 6px; }
table.matrix td.c input { width: 18px; height: 18px; }

/* wybór uczniów */
.picker-class { border-top: 1px solid var(--border-soft); padding: 14px 0; }
.picker-class:first-child { border-top: none; }
.picker-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.picker-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 16px; }
.picker-list label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 14px; }
.picker-list label:hover { background: var(--accent-softer); }
.picker-list input { width: 18px; height: 18px; margin: 0; }
.sticky-bar { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); padding: 14px 22px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }

/* logowanie */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth .card { width: 100%; max-width: 400px; padding: 28px; }
.auth .brand { margin-bottom: 22px; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; letter-spacing: 0.06em; background: var(--accent-softer); padding: 10px 12px; border-radius: var(--radius-sm); word-break: break-all; }
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ====================================================== plan lekcji */
.subtabs { display: flex; flex-wrap: wrap; gap: 4px; margin: -4px 0 20px; border-bottom: 1px solid var(--border); }
.subtabs a { padding: 8px 12px; font-size: 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs a:hover { color: var(--ink); }
.subtabs a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--input); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg a { padding: 0 12px; min-height: 38px; display: flex; align-items: center; color: var(--ink); text-decoration: none; font-size: 14px; border-right: 1px solid var(--input); }
.seg a:last-child { border-right: none; }
.seg a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chips a { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; color: var(--ink); text-decoration: none; }
.chips a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.weeknav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.weeknav .range { font-weight: 600; min-width: 170px; text-align: center; }

/* siatka tygodnia */
table.wk { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; background: var(--surface); }
table.wk th { font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; }
table.wk th.today { color: var(--accent); }
table.wk th .date { display: block; font-weight: 400; }
table.wk th.hour, table.wk td.hour { width: 76px; }
table.wk td { border-bottom: 1px solid var(--border-soft); border-left: 1px solid var(--border-soft); padding: 4px; vertical-align: top; height: 64px; }
table.wk tr:last-child td { border-bottom: none; }
table.wk td.hour { border-left: none; font-size: 12px; color: var(--muted); padding: 8px; line-height: 1.3; }
table.wk td.hour b { display: block; color: var(--ink); font-size: 15px; }
table.wk td.today { background: var(--accent-softer); }
table.wk td.off { background: repeating-linear-gradient(135deg, #F6F7F9, #F6F7F9 8px, #EFF1F4 8px, #EFF1F4 16px); }
.offlabel { font-size: 13px; color: var(--muted); padding: 6px; }
.les { display: block; border-radius: 8px; padding: 6px 8px 6px 10px; font-size: 13px; line-height: 1.3; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--c, var(--accent)); position: relative; }
.les + .les { margin-top: 4px; }
a.les:hover { border-color: #B9C0CA; border-left-color: var(--c, var(--accent)); color: var(--ink); }
.les .s { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.les .m { color: var(--muted); font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.les .tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 999px; margin-top: 3px; }
.les.cancelled .s, .les.moved_out .s { text-decoration: line-through; color: var(--muted); }
.les.cancelled, .les.moved_out { background: #FAFAFB; }
.tag.cancelled, .tag.moved_out { background: var(--err-bg); color: var(--err-ink); }
.tag.sub, .tag.sub_out, .tag.extra, .tag.moved_in { background: var(--warn-bg); color: var(--warn-ink); }
.tag.room { background: var(--accent-soft); color: var(--accent); }
.tag.online { background: #E3F4F3; color: #0B5856; }
.tag.cover { background: var(--err-bg); color: var(--err-ink); }
.les .lnk { font-size: 12px; }
@media (max-width: 780px) {
  table.wk.mobile-stack, table.wk.mobile-stack tbody, table.wk.mobile-stack tr, table.wk.mobile-stack td { display: block; width: auto; height: auto; }
}
.daylist { display: none; }
@media (max-width: 700px) {
  .wk-wrap { display: none; }
  .daylist { display: block; }
}
.daylist .day { margin-bottom: 16px; }
.daylist .day h3 { margin: 0 0 6px; }
.daylist .row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 6px; }
.daylist .row .n { width: 54px; flex: none; font-size: 12px; color: var(--muted); padding-top: 6px; }
.daylist .row .n b { display: block; color: var(--ink); font-size: 14px; }
.daylist .row .les { flex: 1; min-width: 0; }

/* edytor */
.planwrap { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.planmain { flex: 999 1 640px; min-width: 0; overflow-x: auto; }
.planside { flex: 1 1 260px; position: sticky; top: 12px; }
table.tt { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 620px; table-layout: fixed; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.tt th { background: #F3F5F8; font-size: 12px; padding: 8px 6px; font-weight: 600; border-bottom: 1px solid var(--border); }
table.tt th.hour { width: 70px; text-align: left; font-weight: 500; color: var(--muted); font-size: 11px; line-height: 1.2; }
table.tt th.hour b { color: var(--ink); font-size: 14px; display: block; }
table.tt td { border-bottom: 1px solid var(--border-soft); border-left: 1px solid var(--border-soft); padding: 3px; vertical-align: top; height: 58px; transition: background .12s; position: relative; }
table.tt tr:last-child td { border-bottom: 0; }
.cell { display: flex; gap: 3px; height: 100%; }
.lc { flex: 1; min-width: 0; border-radius: 6px; padding: 3px 5px; font-size: 12px; line-height: 1.22; border: 1px solid #0000001a; overflow: hidden; position: relative; }
.lc .s { font-weight: 700; font-size: 12.5px; display: block; }
.lc .t, .lc .r, .lc .g { color: #344054; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.lc.cont { opacity: .55; border-style: dashed; }
.lc.conflict { outline: 2px solid #C0392B; outline-offset: -2px; }
.lc .lock { position: absolute; right: 3px; top: 2px; font-size: 10px; }
.editable .lc:not(.cont) { cursor: grab; }
.lc.sel { box-shadow: 0 0 0 2px var(--accent); }
.lc.dragging { opacity: .35; }
td.ok-best { background: #C9ECD6 !important; }
td.ok { background: #E6F5EC !important; }
td.meh { background: #FBF1D8 !important; }
td.bad { background: #FADCD8 !important; }
td.cur { box-shadow: inset 0 0 0 2px var(--accent); }
td.over { box-shadow: inset 0 0 0 3px var(--accent); }
td .dl { position: absolute; right: 3px; bottom: 1px; font-size: 10px; color: #475467; pointer-events: none; }
.tray { min-height: 64px; border: 2px dashed var(--input); border-radius: var(--radius); padding: 6px; display: flex; flex-wrap: wrap; gap: 4px; background: var(--surface); }
.tray .lc { flex: 0 0 auto; width: 130px; }
.tray.over { border-color: var(--accent); background: var(--accent-softer); }
.detail .opt { display: flex; justify-content: space-between; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.detail .opt:hover { background: var(--accent-soft); }
.progress { height: 8px; background: #E6E9EE; border-radius: 99px; overflow: hidden; margin: 8px 0; }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width .5s; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; border: 1px solid #0001; }
.dragmode #ttwrap .lc:not(.dragging) { opacity: .4; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1B2433; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 50; max-width: 90vw; box-shadow: 0 6px 24px #0003; font-size: 14px; }
.toast.bad { background: #8A1F1F; }

/* siatka dostępności */
table.avail { border-collapse: collapse; user-select: none; background: var(--surface); }
table.avail th, table.avail td { border: 1px solid var(--border); padding: 0; text-align: center; font-size: 12px; }
table.avail th { padding: 5px 8px; background: #F3F5F8; font-weight: 600; cursor: pointer; }
table.avail th.corner { cursor: default; }
table.avail td.c { width: 52px; height: 28px; cursor: pointer; }
table.avail td.c[data-v="0"] { background: #E9F6EE; }
table.avail td.c[data-v="1"] { background: #FDF0CF; }
table.avail td.c[data-v="2"] { background: #F6CBC5; }
table.avail td.c[data-v="1"]::after { content: "?"; color: var(--warn-ink); }
table.avail td.c[data-v="2"]::after { content: "✕"; color: var(--err-ink); }

/* tabela wymiaru godzin */
table.list input.num { width: 64px; min-height: 34px; padding: 5px 8px; }
table.list input.rt { min-height: 34px; padding: 5px 8px; min-width: 120px; }
table.list td.c { text-align: center; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.suggest button { text-align: left; line-height: 1.25; padding: 6px 10px; min-height: 0; flex-direction: column; align-items: flex-start; gap: 0; white-space: normal; }
.suggest button small { display: block; color: var(--muted); font-size: 11px; }

/* wydruk */
.print-only { display: none; }
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; font-size: 11px; }
  .topbar, .sidenav, .noprint, .messages, .subtabs { display: none !important; }
  .content { padding: 0; }
  .print-only { display: block; }
  .wk-wrap { display: block !important; }
  .daylist { display: none !important; }
  .card { border: none; padding: 0; }
  .ppage { break-after: page; }
  .ppage:last-child { break-after: auto; }
  .les, .lc, td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .lc.conflict { outline: 0; }
  table.wk td, table.tt td { height: 44px; }
}
.grid > .card + .card, .cols > * > .card:first-child { margin-top: 0; }

/* ===== dziennik ===== */
.notice { padding: 11px 14px; border-radius: var(--radius-sm); font-size: 14px; background: var(--accent-softer); border: 1px solid #C9D8EA; margin-bottom: 16px; }
.notice.warn { background: var(--warn-bg); border-color: #E9C98F; color: var(--warn-ink); }
.notice.err { background: var(--err-bg); border-color: #F0C2C2; color: var(--err-ink); }
.notice.ok { background: var(--ok-bg); border-color: #B7DCC2; color: var(--ok-ink); }
ul.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.att-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 22px 6px; flex-wrap: wrap; }
.att-head h2 { margin: 0; }
.att { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.att label { cursor: pointer; }
.att input { position: absolute; opacity: 0; pointer-events: none; }
.att span { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 32px; padding: 0 6px; border: 1px solid var(--input); border-radius: 6px; font-size: 13px; color: var(--muted); background: var(--surface); }
.att input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.att input:checked + span { color: #fff; border-color: transparent; font-weight: 600; }
.att .a-ob input:checked + span { background: #2E7D4F; }
.att .a-nb input:checked + span { background: #B23A3A; }
.att .a-u input:checked + span { background: #7A6A2E; }
.att .a-sp input:checked + span { background: #C77A12; }
.att .a-zw input:checked + span { background: #6A5ACD; }
.att .a-sz input:checked + span { background: #2F5D8C; }
.att input:disabled + span { cursor: default; opacity: .8; }
.att-cell { text-align: right; }
tr.info-row td { background: #FBFBFD; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.mk { display: inline-block; min-width: 22px; text-align: center; font-size: 12px; border-radius: 4px; padding: 1px 3px; }
.mk-nb { background: var(--err-bg); color: var(--err-ink); font-weight: 600; }
.mk-u { background: #F4F0DC; color: #5E521F; }
.mk-sp { background: var(--warn-bg); color: var(--warn-ink); }
.mk-zw, .mk-sz { background: var(--accent-soft); color: var(--accent); }
.mk-ob { color: #2E7D4F; }
.mk-zp { color: var(--muted); }
table.grid-table { border-collapse: collapse; font-size: 13px; }
table.grid-table th, table.grid-table td { border-bottom: 1px solid var(--border-soft); padding: 6px 8px; text-align: center; white-space: nowrap; }
table.grid-table th.l, table.grid-table td.l { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; }
table.grid-table thead th { font-weight: 500; color: var(--muted); font-size: 12px; vertical-align: bottom; }
table.grid-table thead th a { color: inherit; }
.vert { writing-mode: vertical-rl; transform: rotate(180deg); max-height: 150px; overflow: hidden; text-overflow: ellipsis; margin: 0 auto; }
table.grid-table.compact { width: auto !important; min-width: 60%; }
.g { display: inline-block; min-width: 26px; padding: 2px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.g.has-comment { box-shadow: inset 0 -2px 0 #C77A12; }
.g.fin { background: var(--accent); color: #fff; }
.g.prop { background: #fff; border: 1px dashed var(--accent); color: var(--accent); }
.pct-low { color: var(--err-ink); font-weight: 600; }
.grade-in { width: 64px; text-align: center; }
.pct-in { width: 70px; text-align: center; }
.col-table input, .col-table select { min-height: 34px; padding: 4px 8px; border: 1px solid var(--input); border-radius: 6px; font: inherit; }
.col-table td { vertical-align: top; }
.col-table textarea { width: 100%; min-width: 180px; min-height: 34px; padding: 4px 8px; border: 1px solid var(--input); border-radius: 6px; font: inherit; resize: vertical; }
.remark { border-left: 3px solid var(--border); padding: 6px 0 6px 12px; }
.remark.pos { border-color: #2E7D4F; }
.remark.neg { border-color: #B23A3A; }
.subj-row { display: grid; grid-template-columns: minmax(140px, 1.2fr) 3fr auto; gap: 10px 16px; align-items: center; padding: 12px 22px; border-bottom: 1px solid var(--border-soft); }
.subj-row:last-child { border-bottom: none; }
.subj-row .gs { display: flex; flex-wrap: wrap; gap: 4px; }
@media (max-width: 700px) { .subj-row { grid-template-columns: 1fr; } .att span { min-width: 32px; } .att-cell { text-align: left; } }
.stats4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.stats4 .stat { font-size: 15px; font-weight: 400; letter-spacing: 0; background: var(--accent-softer); border-radius: var(--radius-sm); padding: 10px 12px; }
.stats4 .stat b { display: block; font-size: 24px; font-weight: 700; }
.stats4 .stat span { color: var(--muted); font-size: 13px; }

/* ===== wiadomości ===== */
.mrow { display: grid; grid-template-columns: minmax(140px, 220px) 1fr auto; gap: 14px; padding: 12px 22px; border-bottom: 1px solid var(--border-soft); color: var(--ink); text-decoration: none; font-size: 14px; align-items: baseline; }
.mrow:last-child { border-bottom: none; }
.mrow:hover { background: var(--accent-softer); }
.mrow-who, .mrow-main { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mrow-date { color: var(--muted); font-size: 13px; white-space: nowrap; }
.mrow.unread .mrow-who, .mrow.unread .mrow-subj { font-weight: 700; }
.mrow.unread { box-shadow: inset 3px 0 0 var(--accent); }
@media (max-width: 700px) { .mrow { grid-template-columns: 1fr auto; } .mrow-main { grid-column: 1 / -1; } }
.msg-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
.msg-body p:first-child { margin-top: 0; } .msg-body p:last-child { margin-bottom: 0; }
.msg-body { overflow-wrap: anywhere; }
.card.msg.mine { background: var(--accent-softer); }
.att-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.att-list a.badge { text-decoration: none; }
.msg-foot { margin-top: 10px; }
.checks.pick { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; margin-top: 6px; }
.card.ann.pinned { border-color: #C9D8EA; box-shadow: inset 3px 0 0 var(--accent); }

/* ===== terminarz ===== */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal th { font-size: 12px; font-weight: 500; color: var(--muted); padding: 8px; text-align: left; border-bottom: 1px solid var(--border); }
.cal td { vertical-align: top; height: 108px; padding: 6px; border-right: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); overflow: hidden; }
.cal td:last-child { border-right: none; }
.cal td.out { background: #FAFBFC; } .cal td.out .cal-day { color: #A7AEB9; }
.cal td.we { background: #FBFBFD; }
.cal td.today .cal-day { background: var(--accent); color: #fff; border-radius: 999px; width: 24px; text-align: center; }
.cal-day { font-size: 13px; font-weight: 600; margin-bottom: 4px; height: 24px; line-height: 24px; }
.cal-ev { display: block; font-size: 12px; line-height: 1.35; padding: 2px 6px; margin-bottom: 3px; border-radius: 4px; background: color-mix(in srgb, var(--c) 14%, white); border-left: 3px solid var(--c); color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.auto { font-style: italic; color: var(--muted); }
.cal-agenda { display: none; }
.ag-day { display: grid; grid-template-columns: 70px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
.ag-day:last-child { border-bottom: none; }
.ag-date { font-size: 13px; font-weight: 600; }
.ag-day .cal-ev { white-space: normal; font-size: 13px; }
@media (max-width: 760px) { .cal-wrap { display: none; } .cal-agenda { display: block; } }
.nav-badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; text-align: center; margin-left: 4px; line-height: 18px; }
