/* ===== Reset & osnove ===== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0 0 8px; font-weight: 600; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
.muted { color: var(--color-muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
[hidden] { display: none !important; }

/* ===== App layout ===== */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 220px;
    flex: 0 0 220px;
    background: var(--color-chrome);
    color: var(--color-chrome-text);
    display: flex;
    flex-direction: column;
}
.sidebar-brand {
    padding: 20px 20px 16px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-logo { max-height: 32px; width: auto; display: block; filter: brightness(0) invert(1); }
.sidebar-nav { padding: 12px 0; display: flex; flex-direction: column; }
.nav-item {
    color: rgba(255, 255, 255, 0.82);
    padding: 11px 20px;
    border-left: 3px solid transparent;
    font-weight: 500;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); text-decoration: none; color: #fff; }
.nav-item.active {
    border-left-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.main-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: 56px;
    flex: 0 0 56px;
    background: var(--color-chrome);
    color: var(--color-chrome-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-user { color: rgba(255, 255, 255, 0.75); font-size: 13px; }
.view { flex: 1; padding: 24px; overflow: auto; }

/* ===== Kartice ===== */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 20px;
}
.card + .card { margin-top: 16px; }
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 14px; color: var(--color-text); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.card-grid .card + .card { margin-top: 0; }

/* ===== Zaglavlje stranice ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 12px;
    flex-wrap: wrap;
}
.page-header h2 { margin: 0; font-size: 20px; }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* ===== Dugmad ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.2;
}
.btn:hover { border-color: #cbd5e1; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-primary-text); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--color-primary); }
.btn-danger { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.06); border-color: var(--color-danger); }
.btn-accent { background: var(--color-accent); border-color: var(--color-accent); color: #3a2f00; }
.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.5); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ===== Tabele ===== */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.table th { font-weight: 600; color: var(--color-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
.table tbody tr:hover { background: #fafbfc; }
.table .row-link { cursor: pointer; }
.table-wrap { overflow-x: auto; }
.table-empty { padding: 24px; text-align: center; color: var(--color-muted); }

/* ===== Bedževi ===== */
.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    background: #e2e8f0;
    color: #475569;
    white-space: nowrap;
}
.badge-ok { background: #dcfce7; color: #15803d; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-warn { background: #ffedd5; color: #c2410c; }
.badge-muted { background: #e2e8f0; color: #475569; }
.badge-kill { background: var(--color-danger); color: #fff; }
.badge-accent { background: #fdf3d3; color: #7a5c00; }

/* ===== Forme ===== */
.field { margin-bottom: 14px; }
.label { display: block; font-size: 12px; font-weight: 600; color: var(--color-muted); margin-bottom: 5px; }
.input, .select, .textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--color-text);
}
.input:focus, .select:focus, .textarea:focus { outline: 2px solid rgba(142, 31, 43, 0.35); outline-offset: 0; border-color: var(--color-primary); }
.textarea { min-height: 78px; resize: vertical; }
.field-error { color: var(--color-danger); font-size: 12px; margin-top: 5px; }
.form-row { display: flex; gap: 12px; }
.form-row .field { flex: 1; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.checkbox-row input { width: 16px; height: 16px; }
.checkbox-row label { margin: 0; }

/* ===== Definicione liste (detalji) ===== */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 13px; align-items: baseline; }
.dl dt { color: var(--color-muted); font-weight: 500; }
.dl dd { margin: 0; }

/* ===== Stat kartice (dashboard) ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 16px 18px; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--color-muted); font-size: 12px; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.4px; }
.stat-card.warn .stat-value { color: var(--color-warn); }
.stat-card.danger .stat-value { color: var(--color-danger); }

/* ===== Modal ===== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 60px 16px; z-index: 100; overflow: auto;
}
.modal {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.4);
    width: 100%; max-width: 520px;
}
.modal-head { padding: 18px 20px; border-bottom: 1px solid var(--color-border); font-weight: 600; font-size: 15px; }
.modal-body { padding: 20px; }
.modal-actions { padding: 16px 20px; border-top: 1px solid var(--color-border); display: flex; justify-content: flex-end; gap: 8px; }
/* Nabrajanje unutar dijaloga (npr. šta sve odlazi sa instancom) — bez oslanjanja na podrazumevane margine. */
.bullet-list { margin: 8px 0 12px; padding-left: 20px; font-size: 13px; }
.bullet-list li { margin-bottom: 4px; }

/* ===== Toast ===== */
.toast-container { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
    min-width: 260px; max-width: 380px;
    padding: 12px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    background: #1e293b; color: #fff; font-size: 13px;
    border-left: 4px solid var(--color-muted);
}
.toast-ok { border-left-color: var(--color-ok); }
.toast-error { border-left-color: var(--color-danger); }

/* ===== Login ===== */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--color-chrome); }
.login-card { width: 100%; max-width: 360px; }
.login-logo { max-height: 40px; margin: 0 auto 12px; display: block; }
.login-title { text-align: center; font-size: 24px; margin-bottom: 2px; color: var(--color-primary); }
.login-sub { text-align: center; color: var(--color-muted); margin: 0 0 20px; }
.login-submit { width: 100%; justify-content: center; margin-top: 8px; }
.login-error { color: var(--color-danger); font-size: 13px; margin: 4px 0 0; }

/* ===== Razno ===== */
.banner { padding: 12px 16px; border-radius: var(--radius); font-size: 13px; margin-bottom: 14px; }
.banner-warn { background: #ffedd5; color: #9a3412; border: 1px solid #fdba74; }
.banner-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.banner-info { background: #e0f2fe; color: #075985; border: 1px solid #7dd3fc; }
.spinner { padding: 40px; display: flex; justify-content: center; }
.spinner-ring {
    width: 32px;
    height: 32px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pagination { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; font-size: 13px; }
.key-reveal { font-family: ui-monospace, monospace; background: #f1f5f9; padding: 12px; border-radius: var(--radius); word-break: break-all; border: 1px dashed var(--color-primary); }
.section-sep { height: 1px; background: var(--color-border); margin: 16px 0; border: 0; }
.inline-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ===== Plan-04: kursevi (lista, detail, upload, kviz builder) ===== */
/* .progress-bar širina se postavlja iz JS-a (element.style.width, CSSOM) — to NIJE inline
   style atribut u HTML-u, pa je CSP-safe. */
.progress { height: 6px; background: var(--color-border); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--color-primary); transition: width 0.2s ease; }
.thumb { max-width: 96px; border-radius: var(--radius); object-fit: cover; border: 1px solid var(--color-border); display: block; }
.thumb-lg { max-width: 200px; }
.option-row, .pair-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.option-row .input, .pair-row .input { flex: 1; width: auto; }
.question-card { margin-top: 16px; }
.question-card .card-title, .card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.question-card .card-title .select { width: auto; }
.video-preview { width: 100%; max-height: 70vh; background: #000; display: block; }
/* modal() nema opciju širine — za video preview se .modal-wide dodaje na .modal čvor iz JS-a
   posle modal() poziva (klasa, ne inline stil). */
.modal-wide { max-width: 760px; }
.qb-points { max-width: 90px; }
.section-actions { margin-top: 16px; }
.upload-status { margin-top: 10px; }
.file-picker { display: inline-flex; }

/* ===== Course detail: outline redizajn (iSpring-like) ===== */
.back-row { margin-bottom: 12px; }
.course-header h1 { font-size: 24px; font-weight: 700; margin: 0 0 6px; }
.outline-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 16px 0 12px;
    flex-wrap: wrap;
}
/* Kartica bez spoljnjeg paddinga — redovi nose svoj; overflow za hover pozadinu uz radius. */
.outline-list { padding: 0; overflow: hidden; }
.module-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 20px;
    background: #fafbfc;
    border-bottom: 1px solid var(--color-border);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--color-muted);
}
.outline-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
}
.outline-row:last-child { border-bottom: 0; }
.outline-row:hover { background: var(--color-bg); }
.outline-actions { display: none; gap: 4px; align-items: center; flex-wrap: wrap; }
.outline-row:hover .outline-actions { display: flex; }
/* Akcije modula su uvek vidljive (zahtev korisnika); hover-only ostaje samo za materijale. */
.module-row .outline-actions { display: flex; }
.item-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
}
.icon-video { background: var(--color-chrome); }
.icon-pdf { background: var(--color-muted); }
.icon-quiz { background: var(--color-primary); }
.outline-main { flex: 1; min-width: 0; }
.outline-title { font-weight: 600; font-size: 14px; }
.outline-sub { color: var(--color-muted); font-size: 12px; margin-top: 1px; }
.add-inline { padding: 12px 20px; }
.add-inline button {
    background: none;
    border: 0;
    padding: 0;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
}
.add-inline button:hover { text-decoration: underline; }
.add-menu { display: grid; gap: 8px; }
.add-menu .btn {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    padding: 12px 14px;
    font-size: 14px;
}

/* ===== Plan-05: tabovi, template biblioteka, ikonica kursa, pozadina pitanja ===== */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.tab {
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 9px 14px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-muted);
    cursor: pointer;
}
.tab:hover { color: var(--color-text); }
.tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.template-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.template-img { display: block; width: 100%; height: 120px; object-fit: cover; background: var(--color-bg); }
.template-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
}
.template-info { min-width: 0; }
.template-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.template-sub { color: var(--color-muted); font-size: 12px; margin-top: 1px; }
/* Kartica kao dugme (izbor pozadine u builderu). */
.template-pick { padding: 0; text-align: left; font-family: inherit; color: inherit; cursor: pointer; }
.template-pick:hover { border-color: var(--color-primary); }

.course-icon, .course-icon-lg {
    object-fit: cover;
    display: block;
    border: 1px solid var(--color-border);
    flex: 0 0 auto;
}
.course-icon { width: 24px; height: 24px; border-radius: 6px; }
.course-icon-lg { width: 32px; height: 32px; border-radius: 8px; }
.title-cell { display: flex; gap: 8px; align-items: center; }
.course-title-row { margin-bottom: 6px; }
.course-title-row h1 { margin: 0; }

/* Pozadina pitanja: URL se postavlja iz JS-a (element.style.backgroundImage, CSSOM) —
   nije inline style atribut, pa je CSP-safe. ::before je veo zbog čitljivosti teksta. */
.question-card.has-bg { position: relative; background-size: cover; background-position: center; }
.question-card.has-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.86);
    border-radius: inherit;
    pointer-events: none;
}
.question-card.has-bg > * { position: relative; }

/* ===== Plan-06: learning content (projekti / folderi / kursevi) ===== */
.browse-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    align-items: start;
}
/* min-width: 0 — bez toga široka tabela razvlači grid kolonu preko ekrana. */
.browse-main { min-width: 0; }

.project-panel { padding: 12px; }
.project-panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--color-muted);
    margin-bottom: 8px;
}
.project-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
}
.project-item:hover { background: var(--color-bg); }
.project-item.active { background: rgba(142, 31, 43, 0.09); font-weight: 600; }
.project-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-actions { display: none; gap: 4px; align-items: center; }
.project-item:hover .project-actions { display: flex; }

.breadcrumb { display: flex; gap: 6px; align-items: center; font-size: 13px; flex-wrap: wrap; }
.breadcrumb a { color: var(--color-primary); }
.breadcrumb-current { font-size: 15px; font-weight: 600; }

/* Ikonice u Title ćeliji su manje od .item-icon-a u outline listi (24px = veličina .course-icon). */
.title-cell .item-icon { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 6px; font-size: 13px; }
.icon-folder { background: var(--color-accent); color: #3a2f00; }
.icon-course { background: var(--color-chrome); color: #fff; }

/* Akcije reda iza "⋯" dugmeta: red ostaje čist, opcije se otvaraju na klik (rowMenu u courses.js). */
.row-menu-wrap { position: relative; display: inline-block; }
.row-menu-trigger { padding: 4px 9px; line-height: 1; color: var(--color-muted); }
.table tbody tr:hover .row-menu-trigger { border-color: #cbd5e1; color: var(--color-text); }
.row-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 50;
    min-width: 160px;
    padding: 4px;
    text-align: left;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.28);
}
.row-menu-item {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: none;
    text-align: left;
    font-size: 13px;
    color: var(--color-text);
    cursor: pointer;
}
.row-menu-item:hover { background: var(--color-bg); }
.row-menu-item.danger { color: var(--color-danger); }
/* Uska kolona: sada je u njoj samo "⋯" dugme. */
.row-actions-cell { width: 48px; min-width: 48px; }
/* Zaglavlja ove tabele su kratka — bez preloma ("Created by" u dva reda). */
.browse-main .table th { white-space: nowrap; }
/* .table-wrap ima overflow-x:auto, a po CSS specifikaciji tada i overflow-y postaje auto — pa
   okvir seče padajući "⋯" meni, koji je position:absolute ispod reda. Tabela sa row menijem MORA
   da nosi ovu klasu; takve tabele imaju malo uskih kolona i horizontalni skrol im ionako ne treba.
   (Ranije je ovo bilo vezano za .browse-main, pa je Publishing tab — koji nije pod njim — dobio
   odsečen meni: od 73px visine videlo se 6px, a „Download" i „Send to instances…" bili nedostupni.) */
.table-wrap.has-row-menus { overflow: visible; }

/* ===== plan-07 F6: prevlačenje redova + Publishing tab ===== */

/* Hvataljka je vidljiva tek na hover reda — tabela ostaje mirna dok se ne krene da se prevlači. */
.drag-handle {
    flex: 0 0 auto;
    color: var(--color-muted);
    cursor: grab;
    opacity: 0;
    user-select: none;
    letter-spacing: -2px;
}
tr:hover .drag-handle { opacity: 1; }
.drag-handle:active { cursor: grabbing; }

.table tr.dragging { opacity: 0.45; }
/* Linija pokazuje gde red pada; box-shadow umesto border-a da red ne poskoči za 2px. */
.table tr.drop-above td { box-shadow: inset 0 2px 0 0 var(--color-primary); }
.table tr.drop-below td { box-shadow: inset 0 -2px 0 0 var(--color-primary); }

.publish-state { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.instance-picker { margin-top: 12px; }
.instance-picker .checkbox-row { margin-bottom: 8px; }
/* Dodela ka arhiviranoj instanci: vidljiva, ali očigledno neaktivna. */
.table tr.muted-row td { opacity: 0.55; }

/* ===== plan-07 F7: kviz Form View editor ===== */

.quiz-form-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.quiz-form-layout > .question-editor { min-width: 0; }

.question-panel { padding: 0; overflow: hidden; }
.question-search { border: 0; border-bottom: 1px solid var(--color-border); border-radius: 0; width: 100%; }
.question-list { max-height: 60vh; overflow-y: auto; }

.question-item {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    border-bottom: 1px solid var(--color-border);
    background: none;
    text-align: left;
    font: inherit;
    color: var(--color-text);
    cursor: pointer;
}
.question-item:hover { background: var(--color-bg); }
.question-item.active { background: var(--color-primary-soft, #f6e9ea); font-weight: 500; }
.question-item.dragging { opacity: 0.45; }
.question-item.drop-above { box-shadow: inset 0 2px 0 0 var(--color-primary); }
.question-item.drop-below { box-shadow: inset 0 -2px 0 0 var(--color-primary); }
.question-item-main { min-width: 0; flex: 1; }
.question-item-title { overflow-wrap: anywhere; }
.question-item-type { font-size: 12px; font-style: italic; color: var(--color-muted); }
.settings-item { font-weight: 500; }

.question-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* Choices: Correct kolona je uska, tekst uzima ostatak. */
.choices-table td, .choices-table th { padding: 6px 8px; }
.choices-table .choice-correct { width: 64px; text-align: center; }
.choices-table input[type="text"], .choices-table input:not([type]) { width: 100%; }
.choices-table .choice-adder input { font-style: italic; }

.feedback-table td, .feedback-table th { padding: 6px 8px; vertical-align: middle; }
.feedback-table .feedback-label { white-space: nowrap; font-weight: 500; width: 90px; }
.feedback-table .feedback-score { width: 96px; }
.feedback-table input, .feedback-table select { width: 100%; }

.add-question-types { display: flex; flex-direction: column; gap: 8px; }

/* ===== Plan-11 UX: quiz builder (preview, mapa grananja, inline validacija) ===== */

.modal-wide { max-width: 860px; }

/* Crvena tačka na pitanju sa problemom u levom panelu. */
.problem-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--color-danger);
    flex: 0 0 auto; align-self: center; margin-left: 6px;
}
.qb-problem { margin: -4px 0 10px; font-size: 12.5px; }

/* Learner preview — boje iz kviza (CSS varijable postavlja preview.js iz settings-a). */
.qp-stage {
    background: var(--qp-bg, #f5f1e8);
    color: var(--qp-text, #1a202c);
    border-radius: var(--radius);
    padding: 22px;
    min-height: 320px;
    display: flex; align-items: center; justify-content: center;
}
.qp-stage.qp-has-bg { background-size: cover; background-position: center; }
.qp-card {
    background: rgba(255, 255, 255, 0.92);
    color: inherit;
    border-radius: var(--radius);
    padding: 22px 24px;
    width: 100%; max-width: 560px;
    display: flex; flex-direction: column; gap: 14px;
}
.qp-title { margin: 0; font-size: 18px; }
.qp-progress { font-size: 12px; opacity: 0.7; }
.qp-intro { margin: 0; }
.qp-facts { margin: 0; font-size: 12.5px; opacity: 0.7; }
.qp-image { max-width: 100%; max-height: 220px; object-fit: contain; border-radius: 6px; }
.qp-options { display: flex; flex-direction: column; gap: 8px; }
.qp-option {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 6px;
    cursor: pointer; background: rgba(255, 255, 255, 0.7);
}
.qp-option:hover { border-color: var(--qp-btn, #8e1f2b); }
.qp-pair { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.qp-btn {
    background: var(--qp-btn, #8e1f2b); color: #fff; border: none;
    align-self: flex-start;
}
.qp-btn:hover { filter: brightness(1.1); }
.qp-verdict { font-size: 22px; font-weight: 700; }
.qp-ok { color: var(--color-ok); }
.qp-bad { color: var(--color-danger); }

/* Mapa grananja. */
.bm-wrap { max-height: 60vh; overflow: auto; }
.bm-svg { width: 100%; height: auto; display: block; }
.bm-node rect { fill: var(--color-surface); stroke: var(--color-border); stroke-width: 1.5; }
.bm-node.bm-question { cursor: pointer; }
.bm-node.bm-question:hover rect { stroke: var(--color-primary); }
.bm-node text { font: 12.5px var(--font); fill: var(--color-text); }
.bm-node .bm-sub { font-size: 10.5px; fill: var(--color-muted); }
.bm-node.bm-end rect { fill: var(--color-bg); stroke-dasharray: 4 3; }
.bm-legend { font-size: 12.5px; }

/* ===== Plan-11 UX: bogatiji dashboard instance ===== */

.stat-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px; margin-bottom: 12px;
}
.stat-tile {
    background: var(--color-bg); border: 1px solid var(--color-border);
    border-radius: var(--radius); padding: 10px 12px;
}
.stat-value { font-size: 17px; font-weight: 700; line-height: 1.3; }
.stat-label { font-size: 11.5px; color: var(--color-muted); margin-top: 2px; }
.spark-box { color: var(--color-primary); }
.spark-label { margin-bottom: 4px; }
.sparkline { width: 100%; max-width: 280px; height: 44px; display: block; }

/* ===== Plan-12 News & Documentation ===== */

/* Renderovan Markdown — preview u editoru i telo članka. */
.md-body { line-height: 1.6; }
.md-body h1, .md-body h2, .md-body h3,
.md-body h4, .md-body h5, .md-body h6 { margin: 18px 0 8px; line-height: 1.3; }
.md-body p { margin: 0 0 12px; }
.md-body ul, .md-body ol { margin: 0 0 12px; padding-left: 22px; }
.md-body li { margin-bottom: 4px; }
.md-body blockquote {
    margin: 0 0 12px;
    padding: 6px 12px;
    border-left: 3px solid var(--color-border);
    color: var(--color-muted);
}
.md-body hr { border: 0; border-top: 1px solid var(--color-border); margin: 18px 0; }
.md-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.md-body pre { overflow-x: auto; padding: 12px; background: var(--color-bg); border-radius: var(--radius); }
.md-body pre code { font-size: 12px; }
.md-body img { max-width: 100%; height: auto; }
.md-body table { width: 100%; border-collapse: collapse; margin: 0 0 12px; }
.md-body th, .md-body td { border: 1px solid var(--color-border); padding: 6px 10px; text-align: left; }

/* Editor: dve kolone iznad 900px, jedna ispod. */
.news-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .news-editor { grid-template-columns: 1fr; } }
.md-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.md-source {
    width: 100%;
    min-height: 420px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
}

/* Dokumentacija: verzije i meta na detalju. */
.doc-version-note { color: var(--color-muted); }
