/* Raspored nastave — statički prikaz za studente */
:root {
  --bg: #f7f8fa; --fg: #1d2430; --muted: #5d6879; --line: #dfe3ea;
  --card: #ffffff; --accent: #2563a8; --accent-soft: #e6f1fb;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; }
.top { background: var(--card); border-bottom: 1px solid var(--line); padding: 18px 0; margin-bottom: 26px; }
.top h1 { margin: 0; font-size: 22px; }

/* Zaglavlje: ustanova, pa naslov rasporeda, pa kontekst stranice. */
.brand { display: flex; flex-direction: column; line-height: 1.25; }
.brand-uni { font-size: 20px; font-weight: 400; }
.brand-fac { font-size: 20px; font-weight: 700; }
.brand-sub { margin: 4px 0 0; font-size: 16px; color: var(--fg); }
.brand-sub a { color: inherit; text-decoration: none; }
.brand-sub a:hover { text-decoration: underline; }
.ctx { margin: 10px 0 0; padding-top: 8px; border-top: 1px solid var(--line); }
.ctx-line { margin: 0; font-size: 14px; color: var(--muted); }
.ctx-line + .ctx-line { margin-top: 2px; color: var(--fg); font-weight: 600; }
.back { display: inline-block; margin-bottom: 8px; color: var(--accent); text-decoration: none; font-size: 14px; }
.back:hover { text-decoration: underline; }
.lede { color: var(--muted); margin: 0 0 18px; }
.muted { color: var(--muted); font-weight: 400; font-size: 13px; }

/* naslovnica */
.prog { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 20px; margin-bottom: 16px; }
.prog h2 { margin: 0 0 12px; font-size: 17px; }
.sems { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sems a { display: block; padding: 7px 14px; border-radius: 6px; text-decoration: none;
  color: var(--accent); background: var(--accent-soft); font-size: 14px; }
.sems a:hover { background: #d7e8f8; }

/* tablice */
table.list { width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-size: 14px; }
table.list th { text-align: left; padding: 9px 12px; background: #eef1f5;
  border-bottom: 1px solid var(--line); font-size: 12px; text-transform: uppercase;
  letter-spacing: .03em; color: var(--muted); }
table.list td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list a { color: var(--accent); text-decoration: none; }
table.list a:hover { text-decoration: underline; }
.courses td:first-child { font-variant-numeric: tabular-nums; }
.nw { white-space: nowrap; }
.num { width: 44px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* Modularna nastava: Turnus × Blok */
.modgrid-wrap { margin: 0 0 34px; }
.modgrid-title { font-size: 17px; margin: 0 0 12px; }
.modgrid { width: 100%; border-collapse: separate; border-spacing: 4px;
  table-layout: fixed; font-size: 13px; }
.modgrid th, .modgrid td { vertical-align: top; }
.mg-corner { width: 96px; text-align: left; padding: 8px 6px; color: var(--muted);
  font-size: 12px; font-weight: 500; }
.mg-blok { background: var(--accent); color: #fff; border-radius: 6px; padding: 8px 10px;
  text-align: center; }
.mg-blok-label { display: block; font-size: 12px; letter-spacing: .08em; font-weight: 700; }
.mg-blok-dates { display: block; font-size: 11px; opacity: .85; margin-top: 2px; font-weight: 400; }
.mg-time { width: 96px; padding: 10px 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.mg-turnus-name { display: block; margin-bottom: 3px; color: var(--fg); font-weight: 700;
  font-size: 13px; }
.mg-cell { background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 10px; }
.mg-cell.mg-empty { color: var(--muted); text-align: center; background: transparent;
  border-style: dashed; }
.mg-turnus { display: inline-block; background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 600; border-radius: 4px; padding: 1px 6px; margin-bottom: 4px; }
.mg-course { display: block; font-weight: 600; line-height: 1.3; }
a.mg-course { color: var(--accent); text-decoration: none; }
a.mg-course:hover { text-decoration: underline; }
.mg-meta { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.mg-sep-cell { background: #eef1f5; border-style: none; color: var(--muted);
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 6px 10px; }
tr.mg-rec .mg-span { background: #fcfbf7; }

/* semestar: predmet kao naslov + tablica njegovih grupa */
.course { margin: 0 0 28px; }
.course-h { font-size: 17px; margin: 0 0 10px; }
.course-h .code { color: var(--muted); font-weight: 400; font-size: 14px; }
/* Grupa bez određenog termina: Napomena zauzima preostale stupce. */
.note-cell { color: var(--fg); }
tr.no-slot td { background: #fbfaf6; }

/* raspored predmeta */
.grp { margin: 0 0 36px; }
.grp h2 { font-size: 17px; border-bottom: 2px solid var(--line); padding-bottom: 6px; margin-bottom: 16px; }
.tbl-head { margin: 18px 0 8px; font-size: 14px; }

/* kalendar */
.cal-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.cal-month { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.cal-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.cal-year { color: var(--muted); font-weight: 400; }
table.cal { width: 100%; border-collapse: collapse; font-size: 12px; }
table.cal th { color: var(--muted); font-weight: 500; font-size: 11px; padding: 2px 0; text-align: center; }
.cal-day { text-align: center; padding: 3px 0; color: var(--muted); }
.cal-on { background: var(--accent-soft); color: var(--accent); font-weight: 600; border-radius: 4px; }
.cal-empty { padding: 3px 0; }

/* Side margins must stay auto: this rule comes after .wrap, so a margin
   shorthand with 0 here would cancel the centring the rest of the page uses. */
.foot { margin: 40px auto 26px; padding-top: 14px; border-top: 1px solid var(--line); }
.disclaimer { margin: 0 0 10px; padding: 12px 16px; background: var(--card);
  border: 1px solid var(--line); border-top: 3px solid var(--accent);
  border-radius: 6px; color: var(--fg); font-size: 13px; line-height: 1.55;
  text-align: center; }
.stamp { margin: 0; color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 640px) {
  .wrap { padding: 0 14px; }
  table.list { font-size: 13px; }
  table.list th, table.list td { padding: 7px 8px; }

  /* Popis predmeta se na uskom zaslonu slaže u kartice, da "Raspored nastave"
     ostane dohvatljiv bez vodoravnog pomicanja. */
  table.list.courses thead { display: none; }
  table.list.courses, table.list.courses tbody,
  table.list.courses tr, table.list.courses td { display: block; width: 100%; }
  table.list.courses tr { padding: 12px 12px 14px; border-bottom: 1px solid var(--line); }
  table.list.courses tr:last-child { border-bottom: 0; }
  table.list.courses td { border: 0; padding: 1px 0; white-space: normal; }
  table.list.courses td::before { content: attr(data-label) ": "; color: var(--muted); font-size: 12px; }
  table.list.courses td.c-name { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
  table.list.courses td.c-name::before,
  table.list.courses td.c-link::before { content: none; }
  table.list.courses td.c-link { margin-top: 10px; }
  table.list.courses td.c-link a { display: inline-block; padding: 7px 14px;
    border-radius: 6px; background: var(--accent-soft); text-decoration: none; }
}
@media print {
  body { background: #fff; }
  .top, .back { display: none; }
  table.list, .cal-month { break-inside: avoid; }
}
