/* ============ Kreda ============ */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #1c1d22;
  --muted: #6a6c75;
  --line: #e3e0d8;
  --html: #e4572e;
  --html-soft: #fde9e2;
  --css: #2f5bd3;
  --css-soft: #e3eafc;
  --ok: #1f8a4c;
  --ok-soft: #dff3e6;
  --err: #c0392b;
  --err-soft: #fbe3e0;
  --code-bg: #1e1f26;
  --code-ink: #e8e6e3;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 20, 30, .05), 0 4px 16px rgba(20, 20, 30, .05);
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--css); }
code {
  font-family: var(--mono);
  font-size: .88em;
  background: #efece5;
  padding: .1em .35em;
  border-radius: 5px;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.9rem; letter-spacing: -.01em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; margin-top: 1.4em; }
.muted { color: var(--muted); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------- Topbar ---------- */
.topbar { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 20; }
.topbar-inner { display: flex; align-items: center; gap: 24px; min-height: 58px; flex-wrap: wrap; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; white-space: nowrap; }
.brand { display: inline-flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.brand-tag {
  display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none;
  background: #2b3a33; border-radius: 8px;
}
.brand-tag svg { display: block; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a {
  color: #c9cad1; text-decoration: none; padding: 6px 12px; border-radius: 8px; font-size: .95rem;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav a.active { color: #fff; background: rgba(255, 255, 255, .14); }
.user { display: flex; align-items: center; gap: 10px; }
.user form { margin: 0; }
.user-name { font-size: .92rem; color: #e5e5ea; }
.user-name small { color: var(--html); font-weight: 700; margin-left: 4px; }
@media (max-width: 720px) {
  .topbar-inner { gap: 8px; padding: 8px 16px; }
  .nav { order: 3; flex-basis: 100%; }
  .user { margin-left: auto; }
  .user-name { display: none; }
}

/* ---------- Dugmad i forme ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: .95rem;
  padding: 9px 16px; border-radius: 9px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; line-height: 1.2;
  background: #ebe8e0; color: var(--ink);
  transition: background .15s, transform .05s;
}
.btn:hover { background: #e0dcd2; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #33353d; }
.btn-check { background: var(--ok); color: #fff; }
.btn-check:hover { background: #18723e; }
.btn-ghost { background: transparent; color: inherit; border-color: rgba(255, 255, 255, .25); }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); }
.btn-danger { background: var(--err-soft); color: var(--err); }
.btn-danger:hover { background: #f6cfc9; }
.btn-sm { padding: 5px 11px; font-size: .85rem; }
.btn-block { width: 100%; }

.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 5px; font-size: .9rem; font-weight: 600; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }
input, select, textarea {
  font: inherit; font-weight: 400; width: 100%;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--css); outline-offset: -1px; border-color: transparent; }

.alert { padding: 10px 14px; border-radius: 9px; margin-bottom: 14px; font-size: .95rem; }
.alert-ok { background: var(--ok-soft); color: #135c33; }
.alert-err { background: var(--err-soft); color: #8c2318; }

/* ---------- Prijava ---------- */
.auth-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(circle at 15% 20%, var(--html-soft) 0, transparent 40%),
    radial-gradient(circle at 85% 80%, var(--css-soft) 0, transparent 45%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 440px; background: var(--surface);
  padding: 32px 28px; border-radius: 18px; box-shadow: var(--shadow); border: 1px solid var(--line);
}
.brand-big { font-size: 1.7rem; margin-bottom: .2em; display: flex; align-items: center; gap: 10px; }
.brand-big .brand-tag { width: 40px; height: 40px; border-radius: 10px; }
.brand-big .brand-tag svg { width: 24px; height: 24px; }
.auth-switch { text-align: center; margin: 18px 0 0; font-size: .95rem; }

/* ---------- Kontrolna tabla ---------- */
.page { padding-block: 28px 48px; }
.hero {
  display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
  margin-bottom: 28px;
}
.hero p { margin: 0; }
.progress-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; min-width: 260px; box-shadow: var(--shadow);
}
.progress-box strong { font-size: 1.4rem; }
.bar { height: 8px; background: #ece9e1; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--html), var(--css)); border-radius: 99px; }

.track-title { display: flex; align-items: center; gap: 10px; margin: 30px 0 14px; }
.badge {
  font-family: var(--mono); font-size: .75rem; font-weight: 700; padding: 3px 8px; border-radius: 6px;
  text-transform: uppercase; letter-spacing: .04em;
}
.badge-html { background: var(--html-soft); color: var(--html); }
.badge-css { background: var(--css-soft); color: var(--css); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; text-decoration: none; color: inherit; box-shadow: var(--shadow);
  transition: transform .15s, border-color .15s;
}
.card:hover { transform: translateY(-2px); border-color: #cfcabe; }
.card-num { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.card h3 { margin: 0; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: .92rem; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: .85rem; }
.dots { display: flex; gap: 5px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #e2ded4; }
.dot.on { background: var(--ok); }
.card.done { border-color: #b8dfc7; }

/* ---------- Lekcija ---------- */
.lesson-head { margin-bottom: 20px; }
.crumbs { font-size: .9rem; margin-bottom: 10px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 22px;
}
.theory { max-width: 76ch; }
.theory p, .theory ul { margin: 0 0 .9em; }
.theory li { margin-bottom: .25em; }
.theory h3:first-child { margin-top: 0; }
.note {
  background: #fff8e6; border-left: 4px solid #e8a317; padding: 10px 14px;
  border-radius: 0 8px 8px 0; margin: 0 0 1em; font-size: .95rem;
}
.section-title { display: flex; align-items: center; gap: 10px; margin: 32px 0 14px; }
.section-title h2 { margin: 0; }

.example { margin-bottom: 16px; }
.example-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.example-head h3 { margin: 0; font-size: 1rem; }
.example-actions { display: flex; gap: 6px; }
pre.code {
  margin: 0; background: var(--code-bg); color: var(--code-ink);
  font-family: var(--mono); font-size: .86rem; line-height: 1.55;
  padding: 14px 16px; border-radius: 10px; overflow-x: auto; white-space: pre;
}
.example-preview { margin-top: 10px; }
.example-preview iframe { width: 100%; height: 220px; }

/* ---------- Vežba / editor ---------- */
.exercise { border-top: 4px solid var(--css); }
.exercise.is-done { border-top-color: var(--ok); }
.ex-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ex-head h3 { margin: 0 0 6px; }
.ex-task { margin: 0 0 14px; }
.ex-status { display: none; }
.exercise.is-done .ex-status { display: inline-block; }

.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 860px) { .editor-grid { grid-template-columns: 1fr; } }
.pane { display: flex; flex-direction: column; min-width: 0; }
.pane-label {
  font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 5px;
}
textarea.code-input {
  min-height: 300px; resize: vertical; flex: 1;
  font-family: var(--mono); font-size: .88rem; line-height: 1.55; tab-size: 2;
  background: var(--code-bg); color: var(--code-ink); border: 0; border-radius: 10px; padding: 14px 16px;
  white-space: pre; overflow: auto;
}
textarea.code-input:focus { outline: 2px solid var(--html); }
/* Editor koda: boje se ne menjaju ni u fokusu, ni kad pregledač ili dodatak pokušaju da ih promene */
textarea.code-input,
textarea.code-input:focus,
textarea.code-input:hover {
  background-color: var(--code-bg) !important;
  color: var(--code-ink) !important;
  -webkit-text-fill-color: var(--code-ink);
  caret-color: #ffd166;
  color-scheme: dark;
  forced-color-adjust: none;
  box-shadow: none;
}
textarea.code-input::selection { background: #3d5a99; color: #fff; -webkit-text-fill-color: #fff; }
textarea.code-input::placeholder { color: #8b8d96; -webkit-text-fill-color: #8b8d96; }
iframe.preview {
  flex: 1; min-height: 300px; width: 100%;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.ex-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.ex-toolbar .hint-k { font-size: .8rem; color: var(--muted); margin-left: auto; }
.results { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; }
.results li { padding: 8px 12px; border-radius: 8px; font-size: .93rem; display: flex; gap: 8px; }
.results li.ok { background: var(--ok-soft); color: #135c33; }
.results li.fail { background: var(--err-soft); color: #8c2318; }
.results li::before { font-weight: 700; }
.results li.ok::before { content: "✓"; }
.results li.fail::before { content: "✗"; }
.results .summary { background: var(--ink); color: #fff; font-weight: 600; }
.results .summary::before { content: none; }
details.hint { margin-top: 12px; font-size: .93rem; }
details.hint summary { cursor: pointer; color: var(--muted); font-weight: 600; }
details.hint div { margin-top: 6px; padding: 10px 14px; background: #fff8e6; border-radius: 8px; }

.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

/* ---------- Vežbaonica ---------- */
.playground .editor-grid { grid-template-columns: 1fr 1fr; }
.playground textarea.code-input, .playground iframe.preview { min-height: 62vh; }
@media (max-width: 860px) {
  .playground .editor-grid { grid-template-columns: 1fr; }
  .playground textarea.code-input, .playground iframe.preview { min-height: 340px; }
}

/* ---------- Nastavnik ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat span { display: block; font-size: .82rem; color: var(--muted); }
.stat strong { font-size: 1.5rem; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters select { width: auto; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.grid { border-collapse: collapse; width: 100%; font-size: .9rem; }
table.grid th, table.grid td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.grid th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #faf9f6; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid td.c { text-align: center; }
.cell { display: inline-block; min-width: 34px; padding: 2px 6px; border-radius: 6px; font-family: var(--mono); font-size: .8rem; text-align: center; }
.cell-0 { background: #f0ede6; color: #a19d93; }
.cell-1 { background: #fff1d6; color: #9a6400; }
.cell-2 { background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.mini-bar { width: 80px; height: 6px; background: #ece9e1; border-radius: 99px; display: inline-block; vertical-align: middle; margin-right: 6px; overflow: hidden; }
.mini-bar span { display: block; height: 100%; background: var(--ok); }
.sub-list { display: grid; gap: 10px; }
.sub-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.sub-item summary { cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sub-item summary .meta { color: var(--muted); font-size: .85rem; margin-left: auto; }
.sub-body { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.sub-body iframe { width: 100%; min-height: 240px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
@media (max-width: 860px) { .sub-body { grid-template-columns: 1fr; } }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form input { width: auto; flex: 1; min-width: 180px; }

.footer { color: var(--muted); font-size: .85rem; padding: 24px 16px 32px; text-align: center; }

/* =========================================================
   v2: prijava, kursevi, admin panel
   ========================================================= */
:root { --warn: #9a6400; --warn-soft: #fff1d6; }

.alert-warn { background: var(--warn-soft); color: #6b4500; }
.btn-google {
  background: #fff; color: #1f1f1f; border-color: #dadce0; gap: 10px; padding: 11px 16px;
}
.btn-google:hover { background: #f6f8fc; }
.btn-ghost-dark { background: transparent; color: var(--muted); }
.btn-ghost-dark:hover { background: var(--err-soft); color: var(--err); }
.linklike { background: none; border: 0; color: var(--muted); font: inherit; font-size: .9rem; cursor: pointer; text-decoration: underline; }
.login-more { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.login-more summary { cursor: pointer; color: var(--muted); font-size: .92rem; font-weight: 600; }
.login-more .form { margin-top: 12px; }
.form small { font-weight: 400; }
.check { display: inline-flex !important; align-items: center; gap: 6px; font-weight: 400 !important; margin-right: 12px; }
.check input { width: auto; }
fieldset.checks { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; margin: 0; }
fieldset.checks legend { font-size: .9rem; font-weight: 600; padding: 0 4px; }

.avatar { width: 28px; height: 28px; border-radius: 50%; }
.subbar { background: #2a2b31; position: sticky; top: 58px; z-index: 19; }
.subnav { display: flex; gap: 2px; overflow-x: auto; }
.subnav a { color: #b9bac2; text-decoration: none; padding: 10px 14px; font-size: .9rem; white-space: nowrap; border-bottom: 2px solid transparent; }
.subnav a:hover { color: #fff; }
.subnav a.active { color: #fff; border-bottom-color: var(--html); }
@media (max-width: 720px) { .subbar { position: static; } }

.badge-muted { background: #ece9e1; color: var(--muted); }
.badge-other { background: #ece4f7; color: #6b3fb0; }
.badge-err { background: var(--err-soft); color: var(--err); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-role-admin { background: var(--ink); color: #fff; }
.badge-role-teacher { background: var(--css-soft); color: var(--css); }
.badge-role-student { background: #ece9e1; color: var(--muted); }

/* Kartice kurseva */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.course-card {
  display: grid; gap: 8px; text-decoration: none; color: inherit; position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow);
  transition: transform .15s, border-color .15s;
}
.course-card:hover { transform: translateY(-2px); border-color: #cfcabe; }
.course-mark { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; }
.course-html .course-mark { color: var(--html); }
.course-css .course-mark { color: var(--css); }
.course-other .course-mark { color: #6b3fb0; }
.course-card h2 { margin: 0; font-size: 1.5rem; }
.course-card h2 small { font-size: .95rem; font-weight: 400; color: var(--muted); }
.course-card p { margin: 0; color: var(--muted); }
.course-meta { display: flex; justify-content: space-between; align-items: baseline; font-size: .9rem; color: var(--muted); margin-top: 6px; }
.course-meta strong { color: var(--ink); font-size: 1.2rem; }
.course-card .bar { margin-top: 0; }
.course-next { font-weight: 600; font-size: .92rem; margin-top: 4px; }

/* Admin pregled */
.two-col { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.two-col > * { min-width: 0; }
.stack { display: grid; gap: 18px; }
.stack .panel { margin: 0; }
.mini-head { display: flex; align-items: center; gap: 8px; font-size: .95rem; margin: 18px 0 8px; }
.panel h2 + .mini-head { margin-top: 4px; }
.bars { display: grid; gap: 4px; }
.bar-row {
  display: grid; grid-template-columns: 48px 1fr 44px 52px; align-items: center; gap: 10px;
  text-decoration: none; color: inherit; padding: 4px 6px; border-radius: 8px; font-variant-numeric: tabular-nums;
}
.bar-row:hover { background: #f4f2ec; }
.bar-row .bar { margin: 0; }
.bar-label { font-weight: 700; font-family: var(--mono); font-size: .88rem; }
.bar-val { text-align: right; font-weight: 600; }
.bar-n { font-size: .82rem; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.feed li { display: flex; gap: 12px; align-items: flex-start; font-size: .93rem; line-height: 1.4; }
.feed a { color: inherit; text-decoration: none; }
.feed a:hover { text-decoration: underline; }
.score {
  display: inline-block; min-width: 46px; text-align: center; padding: 3px 6px; border-radius: 7px;
  font-weight: 700; font-size: .82rem; font-variant-numeric: tabular-nums;
}
.score-hi { background: var(--ok-soft); color: var(--ok); }
.score-mid { background: var(--warn-soft); color: var(--warn); }
.score-lo { background: var(--err-soft); color: var(--err); }
.more { display: inline-block; margin-top: 12px; font-size: .9rem; font-weight: 600; text-decoration: none; }
.progress-row { display: flex; gap: 12px; flex-wrap: wrap; }
.progress-row .progress-box { min-width: 200px; }

/* Tabele i akcije */
td.actions { white-space: normal; min-width: 220px; }
.actions-in { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }
.actions-in form { margin: 0; }
tr.row-off td { opacity: .55; }
tr.edit-row td { background: #faf9f6; white-space: normal; }
.edit-form { max-width: 640px; }
details.confirm { position: relative; }
details.confirm > summary { list-style: none; }
details.confirm > summary::-webkit-details-marker { display: none; }
details.confirm[open] > form, details.confirm[open] > p, details.confirm[open] > button {
  margin-top: 8px;
}
details.confirm > form { background: var(--err-soft); padding: 10px 12px; border-radius: 9px; white-space: normal; max-width: 320px; }
details.confirm > form p { margin: 0 0 8px; font-size: .9rem; }
.sub-actions { margin-top: 10px; }
.add-panel summary { cursor: pointer; }
.add-panel textarea { font-family: var(--mono); font-size: .88rem; }

/* Podešavanja */
.settings .panel { scroll-margin-top: 120px; }
.toc { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.toc a {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); padding: 6px 12px; border-radius: 99px; font-size: .9rem;
}
.toc a:hover { border-color: #cfcabe; }
.steps { padding-left: 20px; margin: 0 0 16px; display: grid; gap: 8px; }
.copy-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; min-width: 0; }
.copy-row code { word-break: break-all; padding: 6px 10px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 14px; align-items: center; margin-bottom: 14px; }
.kv > span { font-weight: 600; font-size: .9rem; }
@media (max-width: 600px) { .kv { grid-template-columns: 1fr; } }
.access-grid input[type=checkbox] { width: 18px; height: 18px; }
.switch-row { display: flex !important; grid-template-columns: none; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #faf9f6; font-weight: 400 !important; cursor: pointer; }
.switch-row input { width: 20px; height: 20px; margin-top: 2px; flex: none; }

/* v3: lozinke i gosti */
[hidden] { display: none !important; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.guest-form { margin-top: 12px; }
.guest-form input { text-transform: uppercase; letter-spacing: .08em; font-family: var(--mono); }
.guest-bar { background: var(--warn-soft); color: #6b4500; font-size: .9rem; padding: 8px 0; border-bottom: 1px solid #f0dcae; }
.code-pill { font-family: var(--mono); font-weight: 700; letter-spacing: .06em; background: var(--ink); color: #fff; padding: 3px 9px; border-radius: 7px; font-size: .9rem; }
.add-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; align-items: start; margin-bottom: 18px; }
.add-grid .panel { margin: 0; }
.add-panel summary { line-height: 1.4; }
.creds { border: 2px solid var(--ok); }
.creds code { font-size: .95rem; }
.login-kinds .badge { margin-right: 4px; }
.pw-opts { display: grid; gap: 6px; align-content: end; padding-bottom: 8px; }
.auth-card .brand-big { margin-bottom: 20px; }
.guest-form input::placeholder, input[name="code"]::placeholder { text-transform: none; letter-spacing: normal; font-family: var(--sans); }

/* =========================================================
   v4: editor kurseva
   ========================================================= */
form.inline { display: inline; margin: 0; }
.small-note { font-size: .85rem; margin: 8px 0 0; }
.warn-text { color: var(--warn); }
.editor-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.editor-head h1 { margin-bottom: 0; }
.editor .crumbs span { color: var(--ink); }

.course-list { display: grid; gap: 12px; }
.course-row { display: flex; gap: 16px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin: 0; }
.course-row-main { min-width: 0; flex: 1 1 360px; }
.course-row-main h2 { margin: 2px 0 2px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 1.25rem; }
.course-row-main h2 a { color: inherit; text-decoration: none; }
.course-row-main h2 a:hover { text-decoration: underline; }
.course-row-main p { margin: 0 0 8px; }
.meta-line { display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: .88rem; color: var(--muted); }
.course-row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.item-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.item-list li { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; flex-wrap: wrap; }
.item-num { font-family: var(--mono); font-weight: 700; color: var(--muted); width: 22px; text-align: right; flex: none; }
.item-main { flex: 1 1 200px; min-width: 0; line-height: 1.35; }
.item-main a { color: inherit; text-decoration: none; }
.item-main a:hover { text-decoration: underline; }
.item-actions { display: flex; gap: 4px; align-items: flex-start; flex-wrap: wrap; }
.checks-grid { display: flex; flex-wrap: wrap; gap: 8px 4px; }
.checks-col { display: grid; gap: 8px; }
.plain-list { margin: 0; padding-left: 18px; }
.danger-zone { border-color: #f1c6c0; }
.danger-zone input { width: 100%; }

.theory-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 860px) { .theory-editor { grid-template-columns: 1fr; } }
.theory-editor .pane { min-width: 0; }
textarea.theory-input { font-family: var(--mono); font-size: .9rem; line-height: 1.55; min-height: 380px; resize: vertical; }
.theory-preview { border: 1px dashed var(--line); border-radius: 10px; padding: 14px 16px; min-height: 380px; max-height: 560px; overflow: auto; max-width: none; }
.syntax-help div { line-height: 1.9; }
.example-edit { display: grid; gap: 6px; margin-bottom: 14px; }
textarea.code-input.code-small { min-height: 150px; }
.sticky-save {
  position: sticky; bottom: 0; z-index: 5; display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); margin-top: 6px;
}

.check-row {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  padding: 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #faf9f6;
}
.check-row select { width: auto; flex: 0 0 auto; }
.check-row input { width: auto; flex: 1 1 160px; min-width: 0; }
.check-row input.c-small { flex: 0 0 110px; }
.check-row input.c-msg { flex: 2 1 260px; }
.c-btns { display: flex; gap: 2px; }
.test-out { margin-top: 14px; }
.test-out .alert { margin-bottom: 8px; }
.ok-mark { color: var(--ok); font-weight: 700; }
.fail-mark { color: var(--err); font-weight: 700; }
.test-table td { white-space: normal; }

/* Kod unutar tamnog bloka (primeri, rešenja učenika) ne dobija svetlu pozadinu kao kod u tekstu */
pre code, pre.code code {
  background: none !important;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font-size: inherit;
  -webkit-text-fill-color: currentColor;
}
pre.code { color: var(--code-ink); }
pre.code ::selection { background: #3d5a99; color: #fff; }
.auth-legal { text-align: center; font-size: .85rem; margin: 16px 0 0; }
.auth-legal a, .footer a { color: var(--muted); }
.legal { max-width: 78ch; }
.legal h2 { margin-top: 1.6em; font-size: 1.15rem; }
.legal li { margin-bottom: .3em; }
.legal-top { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-weight: 700; text-decoration: none; color: var(--ink); }
