/* ===================================================================
   Računarske mreže od nule do eksperta — stilovi sajta za učenje
   =================================================================== */

:root {
  --bg: #f7f8fb;
  --bg-elevated: #ffffff;
  --bg-sidebar: #101828;
  --bg-sidebar-hover: #1d2939;
  --text: #1a2233;
  --text-muted: #5b6474;
  --text-on-sidebar: #d0d5dd;
  --text-on-sidebar-muted: #8a94a6;
  --border: #e4e7ec;
  --accent: #2f6fed;
  --accent-strong: #1a4fc4;
  --accent-soft: #e8effe;
  --success: #12875a;
  --success-soft: #e6f6ee;
  --danger: #d13438;
  --danger-soft: #fdeaea;
  --warning: #b5750a;
  --warning-soft: #fdf3e0;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, 0.12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sidebar-width: 290px;
  --header-height: 60px;
}

:root[data-theme="dark"] {
  --bg: #0d1117;
  --bg-elevated: #161b22;
  --bg-sidebar: #0a0e14;
  --bg-sidebar-hover: #161b22;
  --text: #e6edf3;
  --text-muted: #9aa7b8;
  --text-on-sidebar: #cdd5e0;
  --text-on-sidebar-muted: #78839a;
  --border: #262c36;
  --accent: #5b9bff;
  --accent-strong: #7db0ff;
  --accent-soft: #16223d;
  --success: #3fb884;
  --success-soft: #10291f;
  --danger: #f0696c;
  --danger-soft: #34181a;
  --warning: #e0a53c;
  --warning-soft: #322613;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117;
    --bg-elevated: #161b22;
    --bg-sidebar: #0a0e14;
    --bg-sidebar-hover: #161b22;
    --text: #e6edf3;
    --text-muted: #9aa7b8;
    --text-on-sidebar: #cdd5e0;
    --text-on-sidebar-muted: #78839a;
    --border: #262c36;
    --accent: #5b9bff;
    --accent-strong: #7db0ff;
    --accent-soft: #16223d;
    --success: #3fb884;
    --success-soft: #10291f;
    --danger: #f0696c;
    --danger-soft: #34181a;
    --warning: #e0a53c;
    --warning-soft: #322613;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout shell ---------- */

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  color: var(--text-on-sidebar);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 40;
  transition: transform 0.2s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky;
  top: 0;
  background: var(--bg-sidebar);
  z-index: 2;
}
.sidebar-brand .logo { font-size: 22px; }
.sidebar-brand .title {
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.25;
  color: #fff;
}
.sidebar-brand .subtitle {
  font-size: 11.5px;
  color: var(--text-on-sidebar-muted);
}

.sidebar-section {
  padding: 14px 12px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-on-sidebar-muted);
  font-weight: 700;
}

.sidebar nav { padding-bottom: 30px; }

.side-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px 9px 20px;
  margin: 1px 8px;
  border-radius: 8px;
  color: var(--text-on-sidebar);
  font-size: 14px;
  font-weight: 500;
}
.side-link:hover { background: var(--bg-sidebar-hover); text-decoration: none; }
.side-link.active { background: var(--accent); color: #fff; }
.side-link .ic { width: 18px; text-align: center; opacity: 0.85; flex-shrink:0; }

.module-group { margin-bottom: 2px; }
.module-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 10px 14px 10px 20px;
  margin: 1px 8px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-on-sidebar);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  font-family: var(--font);
}
.module-toggle:hover { background: var(--bg-sidebar-hover); }
.module-toggle .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  font-size: 11px;
  margin-right: 8px;
  flex-shrink: 0;
}
.module-toggle.current .num { background: var(--accent); color: #fff; }
.module-toggle .chev { transition: transform 0.15s ease; opacity: 0.6; font-size: 10px; }
.module-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.module-toggle .label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.module-sub {
  list-style: none;
  margin: 0;
  padding: 2px 0 6px 0;
  display: none;
}
.module-sub.open { display: block; }
.module-sub .side-link { padding-left: 44px; font-size: 13.5px; font-weight: 400; }
.module-sub .side-link .ic { width: 16px; font-size: 12px; }

.module-locked {
  padding: 9px 14px 9px 20px;
  margin: 1px 8px;
  font-size: 13px;
  color: var(--text-on-sidebar-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.module-locked .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  font-size: 11px;
  flex-shrink: 0;
}

/* ---------- Main content ---------- */

.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  z-index: 30;
}

.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  font-size: 16px;
}

.breadcrumbs {
  font-size: 13.5px;
  color: var(--text-muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs .sep { margin: 0 6px; opacity: 0.5; }
.breadcrumbs .current { color: var(--text); font-weight: 600; }

.searchbox {
  position: relative;
  width: 220px;
}
.searchbox input {
  width: 100%;
  padding: 7px 10px 7px 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  font-family: var(--font);
}
.searchbox .ic { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); opacity: 0.5; font-size: 13px; }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  color: var(--text);
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--accent-soft); }

.content {
  flex: 1;
  padding: 36px 40px 80px;
  max-width: 900px;
  width: 100%;
}

.content-wide { max-width: 1100px; }

/* ---------- Typography inside content ---------- */

.content h1 { font-size: 30px; font-weight: 800; margin: 0 0 6px; letter-spacing: -0.01em; }
.content h2 { font-size: 22px; font-weight: 750; margin: 40px 0 14px; padding-top: 6px; border-top: 1px solid var(--border); letter-spacing: -0.005em;}
.content h2:first-of-type { border-top: none; margin-top: 8px; }
.content h3 { font-size: 18px; font-weight: 700; margin: 28px 0 10px; color: var(--accent-strong); }
.content h4 { font-size: 14.5px; font-weight: 700; margin: 20px 0 8px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
.content p { margin: 0 0 14px; color: var(--text); }
.content ul, .content ol { margin: 0 0 16px; padding-left: 24px; }
.content li { margin-bottom: 6px; }
.content strong { font-weight: 700; }
.content blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 8px 8px 0;
  color: var(--text);
}
.content blockquote p:last-child { margin-bottom: 0; }
.content hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.content code {
  font-family: var(--font-mono);
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.88em;
}
.content pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0 0 18px;
}
.content pre code {
  background: none;
  color: var(--text);
  padding: 0;
  font-size: 13.5px;
  line-height: 1.55;
}
.content pre.mermaid {
  background: var(--bg-elevated);
  text-align: center;
  overflow-x: auto;
}

.table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--border); border-radius: var(--radius); }
.content table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.content table th, .content table td {
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}
.content table th {
  background: var(--bg);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}
.content table tr:last-child td { border-bottom: none; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-strong);
  margin-right: 8px;
}
.badge.level { background: var(--success-soft); color: var(--success); }
.badge.time { background: var(--warning-soft); color: var(--warning); }
.meta-row { margin: 14px 0 26px; display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Home page ---------- */

.hero {
  padding: 54px 0 10px;
  text-align: left;
}
.hero h1 { font-size: 38px; margin-bottom: 12px; }
.hero p.lead { font-size: 17px; color: var(--text-muted); max-width: 680px; margin-bottom: 22px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 14.5px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: var(--bg-elevated); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--accent-soft); }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin: 30px 0 40px;
}
.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat-card .num { font-size: 26px; font-weight: 800; color: var(--accent-strong); }
.stat-card .lbl { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.section-title {
  font-size: 21px;
  font-weight: 750;
  margin: 44px 0 18px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.module-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text);
}
.module-card.available:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  border-color: var(--accent);
}
.module-card.locked {
  opacity: 0.55;
  cursor: default;
}
.module-card .mnum {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-strong);
  letter-spacing: 0.03em;
}
.module-card.locked .mnum { color: var(--text-muted); }
.module-card .mtitle { font-size: 15.5px; font-weight: 700; line-height: 1.35; }
.module-card .mbadges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.mini-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.mini-badge.soon { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.mini-badge.done { background: var(--success-soft); color: var(--success); border-color: transparent; }

/* ---------- Module index (lesson list) ---------- */

.lesson-list { display: flex; flex-direction: column; gap: 10px; margin: 20px 0 10px; }
.lesson-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  color: var(--text);
  box-shadow: var(--shadow);
}
.lesson-row:hover { border-color: var(--accent); text-decoration: none; }
.lesson-row .lic {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.lesson-row .ltitle { font-weight: 700; font-size: 15px; }
.lesson-row .ldesc { font-size: 13px; color: var(--text-muted); }
.lesson-row .larrow { margin-left: auto; opacity: 0.4; }

/* ---------- Prev/next footer nav ---------- */

.pagenav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 50px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.pagenav a {
  flex: 1;
  max-width: 46%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pagenav a:hover { border-color: var(--accent); text-decoration: none; }
.pagenav .dir { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.pagenav .ttl { font-weight: 700; font-size: 14px; }
.pagenav .next { text-align: right; margin-left: auto; align-items: flex-end; }

/* ---------- Collapsible solution blocks ---------- */

details.resenje {
  margin: 26px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  overflow: hidden;
}
details.resenje summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
details.resenje summary::-webkit-details-marker { display: none; }
details.resenje summary:before { content: "▶"; font-size: 10px; transition: transform 0.15s ease; }
details.resenje[open] summary:before { transform: rotate(90deg); }
details.resenje .resenje-body { padding: 4px 20px 18px; }
details.resenje .resenje-body h3:first-child { margin-top: 4px; }

/* ---------- Kviz (quiz) interactive ---------- */

.quiz-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.quiz-item .qmeta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.quiz-item .qnum { font-weight: 800; color: var(--accent-strong); font-size: 14px; }
.quiz-item .qtype { font-size: 11.5px; color: var(--text-muted); background: var(--bg); border: 1px solid var(--border); padding: 2px 9px; border-radius: 999px; }
.quiz-item .qtext { font-size: 15.5px; font-weight: 600; margin-bottom: 14px; }
.quiz-item pre { margin: 8px 0 14px; }

.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  background: var(--bg);
  font-size: 14.5px;
  color: var(--text);
}
.quiz-opt:hover { border-color: var(--accent); }
.quiz-opt .letter {
  width: 22px; height: 22px; border-radius: 6px;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
  background: var(--bg-elevated);
}
.quiz-opt.correct { border-color: var(--success); background: var(--success-soft); }
.quiz-opt.correct .letter { background: var(--success); color: #fff; border-color: var(--success); }
.quiz-opt.incorrect { border-color: var(--danger); background: var(--danger-soft); }
.quiz-opt.incorrect .letter { background: var(--danger); color: #fff; border-color: var(--danger); }
.quiz-opt.disabled { pointer-events: none; }

.quiz-tf { display: flex; gap: 10px; }
.quiz-tf button {
  flex: 1;
  padding: 11px 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-family: var(--font);
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  color: var(--text);
}
.quiz-tf button:hover { border-color: var(--accent); }
.quiz-tf button.correct { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.quiz-tf button.incorrect { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }

.quiz-feedback {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  display: none;
}
.quiz-feedback.show { display: block; }
.quiz-feedback.ok { background: var(--success-soft); color: var(--success); }
.quiz-feedback.bad { background: var(--danger-soft); color: var(--danger); }

.quiz-reveal-btn {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  font-family: var(--font);
}
.quiz-answer {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px dashed var(--border);
  font-size: 14px;
  display: none;
}
.quiz-answer.show { display: block; }

.quiz-summary {
  position: sticky;
  bottom: 18px;
  margin-top: 24px;
  background: var(--bg-sidebar);
  color: #fff;
  border-radius: var(--radius);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-lg);
}
.quiz-summary .score { font-size: 20px; font-weight: 800; }
.quiz-summary .note { font-size: 12.5px; color: var(--text-on-sidebar-muted); }
.quiz-summary button {
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
}

/* ---------- Kontrolna lista (checklist) ---------- */

.checklist-progress {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 18px 0 28px;
}
.checklist-progress .bar-track {
  height: 8px;
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
  margin-top: 10px;
}
.checklist-progress .bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  width: 0%;
  transition: width 0.25s ease;
}
.checklist-progress .top-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.checklist-progress .pct { font-weight: 800; color: var(--accent-strong); }
.checklist-progress .reset-btn {
  margin-top: 12px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font);
}

.content .cl-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  list-style: none;
  margin-bottom: 9px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.content ul.cl-list { padding-left: 0; margin: 14px 0 26px; }
.cl-item input[type="checkbox"] { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--accent); flex-shrink: 0; }
.cl-item label { cursor: pointer; flex: 1; }
.cl-item.checked { opacity: 0.6; }
.cl-item.checked label { text-decoration: line-through; }

/* ---------- Glossary (rečnik) ---------- */

.glossary-search { margin: 18px 0 26px; }
.glossary-search input {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
}
.gloss-count { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }
.gloss-grid { display: grid; gap: 14px; }
.gloss-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
}
.gloss-card h3 { margin: 0 0 4px; font-size: 16px; }
.gloss-card .srp { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; font-style: italic; }
.gloss-card p { margin: 0 0 8px; font-size: 14px; }
.gloss-card p:last-child { margin-bottom: 0; }
.gloss-card .lbl { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--accent-strong); margin-right: 6px; }
.gloss-card.hidden { display: none; }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 60px;
  padding: 24px 0 10px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ---------- Overlay for mobile sidebar ---------- */

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 35;
}
.overlay.show { display: block; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .hamburger { display: flex; }
  .searchbox { display: none; }
  .content { padding: 24px 18px 60px; }
  .hero h1 { font-size: 28px; }
  .pagenav { flex-direction: column; }
  .pagenav a { max-width: 100%; }
}

/* ---------- Napredak, sinhronizacija i aplikacija (napredak.js) ---------- */

.sync-status {
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  text-decoration: none;
}
.sync-status:hover { background: var(--accent-soft); text-decoration: none; }
.sync-status[data-status="sinhronizacija"] { animation: rm-pulse 1s ease-in-out infinite; }
@keyframes rm-pulse { 50% { opacity: 0.45; } }

.rm-done-wrap { margin: 32px 0 8px; text-align: center; }
.rm-done-btn {
  font: inherit;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 2px solid var(--accent);
  background: var(--bg-elevated);
  color: var(--accent);
  cursor: pointer;
  min-height: 48px;
}
.rm-done-btn:hover { background: var(--accent-soft); }
.rm-done-btn.done { background: var(--success-soft); border-color: var(--success); color: var(--success); }

.side-link.rm-done::after { content: "✓"; margin-left: auto; color: var(--success); font-weight: 700; padding-left: 6px; }
.side-link.active.rm-done::after { color: #fff; }
.lesson-row.rm-done .ltitle::after { content: " ✓"; color: var(--success); font-weight: 700; }
.module-toggle .rm-mod-count {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--bg-sidebar-hover);
  color: var(--text-on-sidebar-muted);
  flex-shrink: 0;
}
.module-toggle .rm-mod-count.full { background: var(--success); color: #fff; }

.rm-bar { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.rm-bar-fill { height: 100%; background: var(--success); border-radius: 4px; transition: width 0.3s ease; }

.rm-nastavi-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 18px 0 6px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
}
.rm-nastavi-card:hover { background: var(--accent-strong); text-decoration: none; }
.rm-nastavi-lbl { font-size: 13px; opacity: 0.9; font-weight: 600; }
.rm-nastavi-ttl { font-size: 17px; font-weight: 700; }

.rm-pregled-card, .rm-modul-napredak, .rm-nalog-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 12px 0 20px;
  box-shadow: var(--shadow);
}
.rm-pregled-num { font-size: 30px; font-weight: 800; color: var(--success); }
.rm-pregled-lbl { color: var(--text-muted); margin: 2px 0 12px; font-size: 14px; }
.rm-card-progress { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.rm-card-pct { font-size: 12px; color: var(--text-muted); }
.rm-mn-title { font-weight: 700; margin-bottom: 10px; }
.rm-mn-list { margin: 12px 0 0; padding-left: 20px; color: var(--text-muted); font-size: 14px; }

.rm-nalog-status { font-weight: 700; font-size: 16px; }
.rm-nalog-meta { color: var(--text-muted); font-size: 14px; margin-top: 6px; }
.rm-login { display: flex; flex-direction: column; gap: 10px; max-width: 420px; margin: 8px 0 24px; }
.rm-login h3 { margin: 0 0 4px; }
.rm-login input {
  font: inherit;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  min-height: 48px;
}
.rm-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.rm-actions .btn, .rm-login .btn, .rm-install-wrap .btn { min-height: 44px; cursor: pointer; }
.rm-msg { font-size: 14px; margin-top: 6px; color: var(--text-muted); }
.rm-msg.ok { color: var(--success); }
.rm-msg.bad { color: var(--danger); }
.rm-install-wrap { margin: 16px 0; }

.rm-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--bg-sidebar);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  font-size: 14px;
}

@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top); }
}
.rm-nalog-card h3 { margin-top: 0; }
