:root {
  --bg: #f6f5f2; --panel: #ffffff; --panel2: #faf9f7; --line: #e4e1db; --text: #1d1b18;
  --muted: #6f6a62; --accent: #a8322d; --accent-soft: #f6e3e1; --ok: #2f7d4f; --ok-soft: #e1f1e7;
  --warn: #a86b12; --warn-soft: #fbefd9; --bad: #b3261e; --bad-soft: #fbe2df; --code: #f1efeb;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  --c1: #a8322d; --c2: #3a6ea5; --c3: #c98a2b; --c4: #4f8a5b;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161514; --panel: #1f1e1c; --panel2: #252321; --line: #34312d; --text: #ece9e4;
    --muted: #a19b92; --accent: #e0726b; --accent-soft: #3a2422; --ok: #6cc28e; --ok-soft: #1d3326;
    --warn: #e3a948; --warn-soft: #3a2e17; --bad: #ef7b72; --bad-soft: #3d2120; --code: #2b2926;
    --shadow: none; --c1: #e0726b; --c2: #6fa1d6; --c3: #e3a948; --c4: #7cbf8b;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
code { background: var(--code); padding: 1px 5px; border-radius: 4px; font-size: .92em; }

.top { height: 48px; display: flex; align-items: center; gap: 16px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.brand strong { font-size: 15px; } .brand span { color: var(--muted); margin-left: 8px; }
.lock { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ok); background: var(--ok-soft); padding: 3px 10px; border-radius: 99px; cursor: help; }
.lock .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.spacer { flex: 1; } .status { color: var(--muted); font-size: 12px; }

.app { display: grid; grid-template-columns: 290px minmax(0, 1fr) minmax(360px, 32vw); height: calc(100vh - 48px); }
.side, .chat { background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.side { border-right: 1px solid var(--line); position: relative; }
.chat { border-left: 1px solid var(--line); }
.center { overflow: auto; min-width: 0; }

.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 5px 10px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--panel2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn:disabled { opacity: .5; cursor: default; }
input[type=search], input[type=number], select, textarea { border: 1px solid var(--line); background: var(--panel2); border-radius: 6px; padding: 5px 8px; }

/* stablo */
.side-head { display: flex; gap: 6px; padding: 10px; border-bottom: 1px solid var(--line); }
.side-head input { flex: 1; min-width: 0; }
.stablo { flex: 1; overflow: auto; padding: 6px 4px 20px; }
.mapa > .naziv { display: flex; align-items: center; gap: 6px; padding: 4px 8px; cursor: pointer; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; user-select: none; }
.mapa > .naziv::before { content: "▾"; width: 10px; font-size: 10px; }
.mapa.zatvoreno > .naziv::before { content: "▸"; }
.mapa.zatvoreno > .sadrzaj { display: none; }
.mapa .mapa > .naziv { text-transform: none; letter-spacing: 0; font-size: 13px; }
.sadrzaj { padding-left: 10px; }
.dat { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 6px; cursor: pointer; }
.dat:hover { background: var(--panel2); }
.dat.aktivno { background: var(--accent-soft); }
.dat .ext { font-size: 10px; font-weight: 600; width: 34px; text-align: center; border-radius: 4px; padding: 1px 0; background: var(--code); color: var(--muted); flex: none; }
.dat .ext.xlsx, .dat .ext.csv { background: var(--ok-soft); color: var(--ok); }
.dat .ext.md { background: var(--accent-soft); color: var(--accent); }
.dat .ext.pdf, .dat .ext.pptx { background: var(--warn-soft); color: var(--warn); }
.dat .ime { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dat .akcije { flex: none; display: none; gap: 2px; }
.dat:hover .akcije { display: flex; }
.dat .akcija { border: 0; background: none; cursor: pointer; font-size: 13px; padding: 0 3px; color: var(--muted); text-decoration: none; opacity: .75; line-height: 1; }
.dat .akcija:hover { opacity: 1; color: var(--text); }
.dat .novo { font-size: 10px; color: #fff; background: var(--accent); border-radius: 99px; padding: 0 6px; }
.drop-hint { padding: 8px 12px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.drop-overlay { display: none; position: absolute; left: 8px; right: 8px; bottom: 8px; border: 2px dashed var(--accent); border-radius: 10px; background: var(--panel); align-items: center; justify-content: center; text-align: center; padding: 12px; font-weight: 600; pointer-events: none; }
.mapa.cilj { outline: 2px dashed var(--accent); outline-offset: -2px; border-radius: 6px; background: var(--accent-soft); }
.side.drag .drop-overlay { display: flex; }

/* centar */
.prazno { max-width: 820px; margin: 32px auto; padding: 0 24px; }
.prazno h1 { font-size: 22px; margin: 0 0 4px; }
.kartice { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 20px 0; }
.kartica { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; box-shadow: var(--shadow); }
.kartica .br { font-size: 26px; font-weight: 650; }
.kartica .op { color: var(--muted); font-size: 12px; }
.kartica.klik { cursor: pointer; } .kartica.klik:hover { border-color: var(--accent); }
.sigurnost { background: var(--ok-soft); border-radius: 10px; padding: 12px 16px; font-size: 13px; }
.koraci li { margin: 4px 0; }

.alatna { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.alatna .put { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46%; }
.alatna .meta { color: var(--muted); font-size: 12px; }
.tabovi { display: flex; gap: 2px; padding: 8px 16px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab { padding: 6px 12px; border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; cursor: pointer; color: var(--muted); }
.tab.aktivno { background: var(--panel); border-color: var(--line); color: var(--text); margin-bottom: -1px; }
.tab .skr { font-size: 11px; opacity: .7; }
.tijelo { padding: 14px 16px 40px; }
.okvir { width: 100%; height: calc(100vh - 110px); border: 0; background: #fff; }
.md { max-width: 900px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 28px 20px; }
.md table, .bubble table { border-collapse: collapse; margin: 8px 0; font-size: 13px; }
.md th, .md td, .bubble th, .bubble td { border: 1px solid var(--line); padding: 4px 8px; }
.md th, .bubble th { background: var(--panel2); }
.napomena { color: var(--muted); font-size: 12px; margin: 6px 0; }
.upozorenje { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 10px 14px; }

/* tablice */
.tbl-alat { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.tbl-wrap { overflow: auto; max-height: calc(100vh - 210px); border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
table.t { border-collapse: separate; border-spacing: 0; font-size: 12.5px; width: max-content; min-width: 100%; }
table.t th { position: sticky; top: 0; background: var(--panel2); text-align: left; font-weight: 600; cursor: pointer; white-space: nowrap; z-index: 1; }
table.t th, table.t td { padding: 4px 10px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.t td.n, table.t th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.t tr:hover td { background: var(--panel2); }
table.t tfoot td { position: sticky; bottom: 0; background: var(--panel2); font-weight: 600; }
td.pos { color: var(--ok); } td.neg { color: var(--bad); }
td.ok { background: var(--ok-soft) !important; } td.warn { background: var(--warn-soft) !important; } td.bad { background: var(--bad-soft) !important; }

/* analiza */
.analiza { display: grid; gap: 14px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.panel h3 { margin: 0 0 10px; font-size: 14px; }
.kontrole { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin-bottom: 10px; }
.kontrole label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.kontrole select { min-width: 150px; color: var(--text); }
.graf { position: relative; height: 320px; margin-top: 10px; }
.vrste { display: flex; gap: 6px; }

/* chat */
.chat-head { display: flex; gap: 6px; padding: 10px; border-bottom: 1px solid var(--line); }
.chat-head #razgovori { flex: 1; min-width: 0; }
.poruke { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; flex-direction: column; gap: 4px; }
.msg.korisnik { align-items: flex-end; }
.bubble { max-width: 100%; border-radius: 10px; padding: 8px 12px; overflow-wrap: anywhere; }
.korisnik .bubble { background: var(--accent-soft); white-space: pre-wrap; max-width: 92%; }
.claude .bubble { background: var(--panel2); border: 1px solid var(--line); }
.bubble > :first-child { margin-top: 0; } .bubble > :last-child { margin-bottom: 0; }
.bubble pre { overflow: auto; background: var(--code); padding: 8px; border-radius: 6px; }
.bubble table { display: block; overflow: auto; }
.bubble code.link, .md code.link { cursor: pointer; color: var(--accent); text-decoration: underline dotted; }
.koraci-a { font-size: 12px; color: var(--muted); }
.koraci-a summary { cursor: pointer; }
.koraci-a ul { margin: 4px 0; padding-left: 18px; }
.koraci-a li.err { color: var(--bad); }
.meta-p { font-size: 11px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; background: var(--code); border-radius: 99px; padding: 2px 4px 2px 10px; max-width: 100%; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 4px; }
.chip.klik { cursor: pointer; padding-right: 10px; } .chip.klik:hover { background: var(--accent-soft); }
.composer { border-top: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.brze { display: flex; flex-wrap: wrap; gap: 6px; }
.brze button { font-size: 12px; border: 1px solid var(--line); background: var(--panel2); border-radius: 99px; padding: 3px 10px; cursor: pointer; }
.brze button:hover { border-color: var(--accent); color: var(--accent); }
.unos { display: flex; gap: 8px; }
.unos textarea { flex: 1; resize: vertical; min-height: 64px; max-height: 40vh; }
.unos-btn { display: flex; flex-direction: column; gap: 6px; }
.dobrodoslica { color: var(--muted); font-size: 13px; text-align: center; margin: auto 10px; }
.dobrodoslica .potvrda { background: var(--ok-soft); color: var(--ok); border-radius: 8px; padding: 10px; margin: 10px 0; }
.kursor::after { content: "▋"; animation: tr 1s steps(2) infinite; margin-left: 2px; color: var(--accent); }
@keyframes tr { 50% { opacity: 0; } }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 8px 16px; border-radius: 8px; z-index: 50; box-shadow: var(--shadow); max-width: 80vw; }

@media (max-width: 1100px) {
  .app { grid-template-columns: 240px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 46vh; }
  .chat { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
}

.side-head { position: relative; }
.izbornik-mapa { position: absolute; top: 100%; right: 8px; z-index: 20; min-width: 220px; max-height: 60vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.15); padding: 6px; }
.izbornik-mapa .naslov { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 4px 8px; }
.izbornik-mapa .stavka { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--text); padding: 6px 8px; border-radius: 6px; cursor: pointer; font: inherit; }
.izbornik-mapa .stavka:hover { background: var(--panel2); }
.izbornik-mapa .stavka.pod { padding-left: 24px; }
.izbornik-mapa small { color: var(--muted); font-size: 11px; }

.dlg-pozadina { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.dlg { width: min(420px, 100%); background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.3); padding: 18px 20px; }
.dlg h3 { margin: 0 0 8px; font-size: 16px; }
.dlg p { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.dlg label { display: block; font-size: 12px; color: var(--muted); margin: 4px 0 6px; }
.dlg-unos { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); color: var(--text); font: inherit; }
.dlg-unos:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.dlg-gumbi { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.btn.opasno { background: var(--accent); color: #fff; border-color: var(--accent); }

.hover-opis { position: fixed; z-index: 200; max-width: 280px; background: var(--text); color: var(--panel); font-size: 12px; line-height: 1.45; padding: 8px 10px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.25); pointer-events: none; }

pre.json { margin: 0; padding: 12px 14px; background: var(--code); border-radius: 8px; overflow: auto; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.tbl-wrap.prelom td { white-space: normal; max-width: 900px; overflow: visible; text-overflow: clip; vertical-align: top; }
table.t td.dugi { white-space: pre-wrap; word-break: break-word; min-width: 320px; max-width: 560px; vertical-align: top; overflow: visible; text-overflow: clip; }
table.t tbody td:not(.n) { cursor: default; }
.dlg.dlg-sirok { width: min(760px, 100%); }
.dlg-tekst { white-space: pre-wrap; word-break: break-word; max-height: 60vh; overflow: auto; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; line-height: 1.55; }
.izbor-mapa { max-height: 50vh; overflow: auto; margin: 4px -6px 0; }
.izbor-mapa .stavka { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--text); padding: 7px 10px; border-radius: 6px; cursor: pointer; font: inherit; }
.izbor-mapa .stavka:hover:not(:disabled) { background: var(--panel2); }
.izbor-mapa .stavka.pod { padding-left: 26px; }
.izbor-mapa .stavka.trenutna { opacity: .45; cursor: default; }
.izbor-mapa small { color: var(--muted); font-size: 11px; }
.dat[draggable="true"] { cursor: grab; }

/* sign-in (the server's page only; the local tool had a token instead) */
.prijava { z-index: 1000; background: var(--bg); }
.prijava[hidden] { display: none; }
.prijava .dlg { width: min(360px, calc(100vw - 32px)); }
.prijava label { display: block; margin-top: 10px; }
.prijava-greska { color: var(--bad); min-height: 1.2em; margin: 10px 0 0; }
.korisnik { color: var(--muted); font-size: 13px; margin: 0 6px 0 12px; }
a.btn { text-decoration: none; color: inherit; display: inline-flex; align-items: center; }
.top .brand { cursor: pointer; }
.top .info { font-size: 17px; line-height: 1; padding: 4px 8px; }
/* the decoupage site's logo and its italic name, so the members' corner looks like part of the site */
.top .brand { display: flex; align-items: center; gap: 8px; }
.top .brand svg, .prijava-naslov svg { width: 26px; height: 26px; flex: none; }
.top .brand strong, .prijava-naslov span { font-style: italic; font-weight: 600; color: #b5655a; font-family: Georgia, "Times New Roman", serif; font-size: 17px; }
.prijava-naslov { display: flex; align-items: center; gap: 8px; }
.top a.brand { text-decoration: none; }
/* the decoupage site's sections as drawings across the header, each a link to it (new tab, so the
   work here is not lost); the site's own motifs and colours */
.ukras { flex: 1; display: flex; align-items: center; justify-content: space-evenly; gap: 10px; padding: 0 14px; margin-left: 2px; border-left: 1px dotted #d9c6b0; border-right: 1px dotted #d9c6b0; align-self: stretch; }
.ukras a { display: flex; align-items: center; gap: 7px; text-decoration: none; color: #8a5a44; font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 14px; padding: 2px 8px; border-radius: 8px; }
.ukras a:hover { background: #f6e9e2; color: #b5655a; }
.ukras svg { width: 34px; height: 34px; flex: none; transition: transform .15s; }
.ukras a:nth-child(even) svg { transform: rotate(-6deg); }
.ukras a:hover svg { transform: scale(1.12) rotate(-4deg); }
@media (max-width: 1350px) { .ukras span { display: none; } }
@media (max-width: 1000px) { .ukras { visibility: hidden; } }
