/* Chakra Petch (SIL Open Font License, vendor/fonts/OFL.txt) — lokalno zbog CSP-a, kao na teza.tools. */
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/vendor/fonts/chakra-petch-500-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/vendor/fonts/chakra-petch-500-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/vendor/fonts/chakra-petch-600-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/vendor/fonts/chakra-petch-600-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/vendor/fonts/chakra-petch-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/vendor/fonts/chakra-petch-700-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: dark;
  --bg: #151819;
  --surface: #1c2022;
  --surface-2: #24292c;
  --surface-3: #2d3438;
  --border: #394247;
  --border-strong: #626f76;
  --ink: #eef0ef;
  --ink-2: #c5ccca;
  --muted: #a2aeaa;
  --brand-grad: linear-gradient(105deg, #e0219a 0%, #b524b8 48%, #17a7d6 100%);
  --brand-magenta: #e0219a; --brand-cyan: #17a7d6;
  --chart-gpu: #1a9fcf; --chart-host: #e0219a;
  --hdr-surface: #111318; --hdr-border: #23252f; --hdr-border-strong: #31343f; --hdr-hover: #1b1d27;
  --hdr-warn: #eaa31e; --hdr-primary-ink: #f34ab4; --hdr-primary-soft: rgba(224, 33, 154, .16);
  --primary: #ac3d69;
  --primary-hover: #be4877;
  --primary-ink: #e9a1bc;
  --primary-soft: rgba(233, 161, 188, .1);
  --cyan: #94bcc4;
  --cyan-soft: rgba(148, 188, 196, .12);
  --ok: #8fc4a2;
  --ok-soft: rgba(143, 196, 162, .1);
  --warn: #e4bb77;
  --warn-soft: rgba(228, 187, 119, .1);
  --error: #f2a29a;
  --error-soft: rgba(242, 162, 154, .1);
  --radius-xs: 3px;
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 8px;
  --radius-pill: 20px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .2);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, .3);
  --font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Chakra Petch", "IBM Plex Sans", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font: 15px/1.5 var(--font-body);
}
:root[data-theme=light] {
  color-scheme: light;
  --chart-gpu: #17a7d6; --chart-host: #e0219a;
  --hdr-surface: #f7f8fb; --hdr-border: #d5d8e2; --hdr-border-strong: #c2c6d2; --hdr-hover: #e2e5ec;
  --hdr-primary-ink: #c0198a; --hdr-primary-soft: rgba(224, 33, 154, .12);
  --bg: #f4f4f0;
  --surface: #fff;
  --surface-2: #f4f5f2;
  --surface-3: #e9eeeb;
  --border: #d4dcd7;
  --border-strong: #87988e;
  --ink: #232d28;
  --ink-2: #49564e;
  --muted: #5d6b62;
  --primary: #97365e;
  --primary-hover: #822b50;
  --primary-ink: #97365e;
  --primary-soft: rgba(151, 54, 94, .08);
  --cyan: #306a75;
  --cyan-soft: rgba(48, 106, 117, .09);
  --ok: #336b47;
  --ok-soft: rgba(51, 107, 71, .08);
  --warn: #855716;
  --warn-soft: rgba(133, 87, 22, .08);
  --error: #ad3b32;
  --error-soft: rgba(173, 59, 50, .08);
  --shadow-sm: 0 1px 3px rgba(35, 45, 40, .1);
  --shadow-lg: 0 16px 48px rgba(35, 45, 40, .16);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background: var(--bg);
}
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea, summary, [tabindex] { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled, fieldset:disabled .drop-zone { cursor: not-allowed; opacity: .55; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
code, pre, .mono { font-family: var(--font-mono); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: fixed; top: -80px; left: 16px; z-index: 60; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 10px 20px; }
.skip:focus { top: 16px; }

/* ---------- Zaglavlje ---------- */
.site-header, main, footer { width: 100%; max-width: max(80vw, 1240px); margin-inline: auto; padding-inline: 32px; }
main { flex: 1; padding-block: 28px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.2px; line-height: 1.1; color: var(--brand-magenta); }
.brand-accent { color: var(--brand-cyan); }
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-block: 24px; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.quiet-link { color: var(--muted); font-size: 12px; text-decoration: none; }
.quiet-link:hover { color: var(--ink); }
.quiet-link.dim { color: var(--muted); opacity: .7; }
.quiet-link.dim:hover { opacity: 1; color: var(--ink-2); }
.service-state { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-family: var(--font-mono); font-size: 11px; padding: 6px 10px; border: 1px solid var(--hdr-border); border-radius: var(--radius-pill); background: var(--hdr-surface); }
.service-state i { width: 7px; height: 7px; background: currentColor; border-radius: 50%; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.service-state.ready { color: var(--ok); }
.service-state.ready i { animation: pulse 1.8s ease-in-out infinite; }
.service-state.unavailable { color: var(--warn); }
.theme-toggle { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--hdr-border); border-radius: var(--radius-pill); background: var(--hdr-surface); color: var(--ink-2); }
.theme-toggle:hover { border-color: var(--hdr-border-strong); color: var(--ink); }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .sun { display: none; }
:root[data-theme=light] .theme-toggle .sun { display: block; }
:root[data-theme=light] .theme-toggle .moon { display: none; }

.eyebrow { font-size: 12px; font-weight: 500; margin: 0 0 8px; color: var(--muted); }
h1 { margin: 0 0 12px; font-size: 30px; font-weight: 600; line-height: 1.25; letter-spacing: -.5px; }
h2 { font-size: 18px; font-weight: 600; line-height: 1.35; letter-spacing: -.2px; margin: 0; }

/* ---------- Paneli ---------- */
.workspace-grid { margin-top: 26px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .8fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
#extractForm { display: contents; }
.doc-panel .form-section.first { margin-bottom: 0; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; min-width: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 24px; }
.panel-heading .eyebrow { margin-bottom: 5px; }
.tag { font-size: 11px; font-weight: 500; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 4px 8px; border-radius: var(--radius-sm); white-space: nowrap; }
.tag.complete { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.review { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag.failed { background: var(--error-soft); color: var(--error); border-color: transparent; }
.tag.busy { background: var(--cyan-soft); color: var(--cyan); border-color: transparent; }
fieldset { padding: 0; border: 0; min-width: 0; margin: 0; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--ink-2); }
input[type=password], input[type=text], input[type=number], textarea, select { width: 100%; min-width: 0; background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; transition: border-color .15s; }
input:hover, textarea:hover, select:hover { border-color: var(--border-strong); }
input:focus, textarea:focus, select:focus { border-color: var(--cyan); outline: 2px solid var(--cyan); outline-offset: 2px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 400; color: var(--ink-2); margin: 0; }
input[type=checkbox] { accent-color: var(--primary); margin: 0; flex-shrink: 0; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 8px 0 0; }
.hint code { font-size: 11px; color: var(--ink-2); background: var(--surface-2); border-radius: var(--radius-xs); padding: 1px 4px; }
.form-section { margin: 24px 0; }

/* Zona za prevlačenje */
.drop-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 24px 16px; cursor: pointer; background: var(--surface-2); min-height: 164px; transition: border-color .15s, background .15s; }
.drop-zone:hover, .drop-zone.over { border-color: var(--cyan); background: var(--cyan-soft); }
.drop-zone.selected { border-style: solid; border-color: var(--primary-ink); background: var(--primary-soft); }
.drop-zone strong { font-size: 14px; max-width: 100%; overflow-wrap: anywhere; color: var(--ink); }
.drop-zone > span:not(.document-icon) { font-size: 12px; color: var(--muted); font-weight: 400; }
.document-icon { width: 28px; height: 34px; border: 1px solid var(--muted); border-radius: var(--radius-xs); display: grid; align-content: center; gap: 4px; padding: 6px; margin-bottom: 8px; background: var(--surface); }
.document-icon span { height: 1px; background: var(--muted); }
.document-icon span:last-child { width: 60%; }
.clear-file { margin-top: 7px; }

/* ---------- PDF pregled ---------- */
.viewer { display: flex; flex-direction: column; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); overflow: hidden; }
.viewer-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 10px; padding: 8px 10px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.viewer-file { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 100%; }
.viewer.expanded .viewer-file { flex: 1 1 220px; }
.viewer-file .document-icon { width: 18px; height: 22px; padding: 4px; gap: 2px; margin: 0; transform: none; border-width: 1px; flex-shrink: 0; }
.viewer-name { font-size: 11.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-size { font-family: var(--font-mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.viewer-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; min-width: 0; max-width: 100%; }
.vbtn { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 32px; padding: 0 7px; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--ink-2); font-size: 12px; line-height: 1; }
.vbtn:hover:not(:disabled) { background: var(--surface-3); border-color: var(--border-strong); color: var(--ink); }
.vbtn[aria-pressed=true] { background: var(--cyan-soft); color: var(--cyan); border-color: transparent; }
.vbtn.danger:hover:not(:disabled) { color: var(--error); }
.vbtn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.vbtn .vlabel { display: none; }
.vsep { width: 1px; height: 18px; background: var(--border-strong); margin: 0 4px; }
.viewer-page { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.viewer-page input { width: 42px; padding: 4px 6px; text-align: center; font-family: var(--font-mono); font-size: 11px; border-radius: var(--radius-sm); -moz-appearance: textfield; }
.viewer-page input::-webkit-outer-spin-button, .viewer-page input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.viewer-body { display: flex; min-height: 0; height: 440px; max-height: 62vh; }
.viewer-thumbs { display: flex; flex-direction: column; gap: 10px; width: 118px; padding: 12px; overflow: auto; border-right: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
.vthumb { position: relative; padding: 0; border: 2px solid transparent; border-radius: var(--radius-sm); background: transparent; overflow: hidden; }
.vthumb canvas { display: block; border-radius: 2px; box-shadow: var(--shadow-sm); }
.vthumb span { position: absolute; right: 4px; bottom: 4px; font: 500 9px/1 var(--font-mono); color: #fff; background: rgba(8, 9, 13, .75); border-radius: var(--radius-xs); padding: 3px 5px; }
.vthumb:hover { border-color: var(--border-strong); }
.vthumb.current { border-color: var(--primary-ink); }
.viewer-stage { position: relative; flex: 1; min-width: 0; overflow: auto; padding: 16px; background: var(--bg); scrollbar-width: thin; }
.viewer-stage:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--cyan); }
.viewer-page-wrap { position: relative; margin: 0 auto; box-shadow: var(--shadow-lg); border-radius: 2px; background: #fff; }
.viewer-page-wrap canvas { display: block; border-radius: 2px; }
.viewer-hl { position: absolute; inset: 0; pointer-events: none; }
.viewer-hl i { position: absolute; background: rgba(224, 33, 154, .32); outline: 1.5px solid rgba(224, 33, 154, .75); border-radius: 2px; mix-blend-mode: multiply; animation: hl-in .45s ease; }
.viewer-loading { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-mono); font-size: 11px; color: var(--muted); background: var(--bg); padding: 20px; text-align: center; }
.viewer-foot { display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 6px 12px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.viewer-foot:empty { display: none; }
.viewer-foot.found { color: var(--primary-ink); }
.viewer.expanded { position: fixed; inset: 14px; z-index: 50; border-radius: var(--radius-lg); }
.viewer.expanded .viewer-body { height: auto; max-height: none; flex: 1; }
.viewer.expanded .vbtn .vlabel { display: inline; margin-left: 5px; }
.viewer.expanded .viewer-thumbs { width: 150px; }
body.viewer-open { overflow: hidden; }
body.viewer-open::after { content: ""; position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .65); }
.page-link { font: inherit; color: var(--cyan); background: var(--cyan-soft); border: 0; border-radius: var(--radius-xs); padding: 1px 6px; text-decoration: none; cursor: pointer; }
.page-link:hover { background: var(--cyan); color: var(--surface); }

/* Polja */
.label-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.label-row label { margin-bottom: 0; }
.label-tools { display: inline-flex; align-items: baseline; gap: 12px; }
.field-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.field-count.limit { color: var(--warn); }
.templates { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 11px; }
.template { font-size: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--ink-2); padding: 6px 12px; }
.template:hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--ink); }
textarea { display: block; resize: vertical; min-height: 132px; line-height: 1.7; font-family: var(--font-mono); font-size: 13px; }
.field-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.field-chips:empty { display: none; }
.chip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; max-width: 100%; font-size: 12px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 8px; }
.chip > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.chip b { font-family: var(--font-mono); font-size: 11px; font-weight: 400; color: var(--muted); }
.chip.required { border-color: color-mix(in srgb, var(--primary-ink) 45%, var(--border)); }
.chip.required::after { content: "obavezno"; font-size: 11px; color: var(--primary-ink); }
.chip.invalid { color: var(--error); border-color: var(--error); }
.language-label { margin-top: 18px; }
.options-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 10px; }
.options-row > div { min-width: 0; }
.type-badge.vision { color: var(--primary-ink); background: var(--primary-soft); }
.evidence.vision { border-left-color: var(--primary); }
.source-label.vision, .evidence.vision .source-label { color: var(--primary-ink); }
p.source-label { margin: 0 0 6px; }
select { padding-block: 9px; }

/* Dugmad */
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-radius: var(--radius); padding: 10px 14px; font-size: 13px; font-weight: 600; }
.primary { width: 100%; min-height: 44px; justify-content: space-between; background: var(--primary); color: #fff; border: 1px solid transparent; margin-top: 24px; padding: 12px 16px; font-size: 14px; transition: background .15s; }
.primary:hover:not(:disabled) { background: var(--primary-hover); }
.primary > span:last-child { font-size: 18px; line-height: 1; }
.primary kbd { font: 400 11px/1 var(--font-mono); color: #fff; border: 1px solid rgba(255, 255, 255, .4); border-radius: var(--radius-xs); padding: 3px 5px; margin-left: 10px; vertical-align: middle; }
.secondary { color: var(--ink); background: var(--surface); border: 1px solid var(--border-strong); }
.secondary:hover:not(:disabled) { border-color: var(--border-strong); background: var(--surface-3); }
.compact { font-size: 12px; padding: 8px 10px; }
.text-button { color: var(--cyan); background: none; border: 0; padding: 3px 0; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover { color: var(--ink); }
.danger { color: var(--error); }
.privacy-note { font-size: 12px; line-height: 1.6; color: var(--muted); margin: 16px 0 0; }

/* ---------- Rezultat ---------- */
.result-panel { min-height: 400px; }
.empty-state { padding: 32px 0; border-top: 1px solid var(--border); color: var(--muted); }
.empty-state h3 { font-size: 15px; color: var(--ink-2); font-weight: 500; margin: 0 0 12px; }
.empty-state p { font-size: 14px; max-width: 42ch; margin: 0; line-height: 1.7; }
.resume-card { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--cyan); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.resume-card strong { font-size: 14px; }
.resume-card p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.job-status { display: flex; align-items: center; gap: 11px; border-block: 1px solid var(--border); padding: 16px 0; margin-bottom: 12px; min-width: 0; }
.job-status > div { flex: 1; min-width: 0; }
.job-status strong { font-size: 14px; }
.job-status p { margin: 4px 0 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.status-dot { width: 8px; height: 8px; flex-shrink: 0; background: var(--cyan); border-radius: 50%; }
[aria-busy=true] .status-dot { animation: pulse 1.6s ease infinite; }
.elapsed { font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tracking-actions { display: flex; gap: 12px; align-items: center; margin-bottom: 15px; }
.tracking-actions > span { font-size: 12px; color: var(--muted); }

/* Sažetak i statistika */
.result-summary { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 20px 0 0; }
.result-summary span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.result-summary span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.result-summary .found::before { background: var(--ok); }
.result-summary .review::before { background: var(--warn); }
.result-summary .missing::before { background: var(--error); }
.result-summary:empty { display: none; }
.document-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 16px 0; padding-block: 16px; border-block: 1px solid var(--border); }
.document-stats div { min-width: 0; }
.document-stats dt { font-size: 12px; color: var(--muted); }
.document-stats dd { font-size: 16px; margin: 4px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.confidence-note { font-size: 12px; line-height: 1.6; color: var(--muted); margin-bottom: 20px; }

/* Polje u rezultatu */
.field-result { border-top: 1px solid var(--border); padding: 16px 0; min-width: 0; }
.field-result:first-child { border-top: 0; padding-top: 4px; }
.field-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.field-top h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; font-size: 13px; font-weight: 500; color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.type-badge { font-family: var(--font-mono); font-size: 11px; color: var(--muted); background: var(--surface-2); border-radius: var(--radius-xs); padding: 1px 5px; }
.field-tools { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.field-score { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.meter { width: 56px; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 2px; background: var(--ok); }
.meter.medium i { background: var(--warn); }
.meter.low i { background: var(--error); }
.copy-value { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--muted); }
.copy-value:hover { color: var(--ink); border-color: var(--border-strong); }
.copy-value.done { color: var(--ok); border-color: var(--ok); }
.copy-value svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.field-value { font-size: 17px; font-weight: 500; margin: 8px 0 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.field-value.missing { font-size: 13px; color: var(--muted); font-weight: 400; font-style: italic; }
.evidence { border-left: 2px solid var(--border-strong); padding: 2px 0 2px 12px; margin: 8px 0; font-size: 13px; line-height: 1.6; color: var(--ink-2); overflow-wrap: anywhere; }
.evidence.verified { border-left-color: var(--cyan); }
.source-label { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.evidence.verified .source-label { color: var(--cyan); }
.field-warning, .review-notice { color: var(--warn); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); border-radius: var(--radius); font-size: 12px; padding: 8px 10px; margin-block: 9px; overflow-wrap: anywhere; }
.review-notice { font-size: 13px; padding: 12px 14px; margin-top: 16px; }
.alternatives { font-size: 12px; color: var(--muted); margin-top: 12px; }
.alternatives p { overflow-wrap: anywhere; }

/* Akcije */
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-top: 1px solid var(--border); padding-top: 18px; margin-top: 4px; }
.result-actions .text-button { margin-left: auto; }
.retention { color: var(--muted); font-size: 12px; margin-top: 16px; overflow-wrap: anywhere; }
.retention:empty { display: none; }
.raw-result { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 16px; font-size: 13px; color: var(--muted); }
summary { cursor: pointer; }
summary:hover { color: var(--ink); }
pre { background: var(--surface-2); border: 1px solid var(--border); font: 12px/1.7 var(--font-mono); overflow: auto; max-height: 360px; padding: 16px; border-radius: var(--radius); color: var(--ink-2); }
.notice { display: flex; gap: 14px; align-items: start; justify-content: space-between; border: 1px solid color-mix(in srgb, var(--error) 35%, transparent); color: var(--error); background: var(--error-soft); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px; }
.notice p { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.notice.success { color: var(--ok); background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.icon-button { display: inline-grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; background: none; border: 0; border-radius: var(--radius-sm); color: inherit; font-size: 22px; line-height: 1; padding: 2px; }
.icon-button:hover { background: var(--surface-2); }

/* ---------- Podnožje ---------- */
footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; color: var(--muted); font-size: 12px; padding-block: 24px; border-top: 1px solid var(--border); }
.made-by { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink-2); }
.made-by:hover { color: var(--ink); }
.made-by .tm-mark { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: var(--radius-xs); background: var(--brand-grad); color: #fff; font: 700 11px/1 var(--font-body); }
.made-by b { font-weight: 600; }

/* ---------- Profil u zaglavlju ---------- */
.profile { display: inline-flex; align-items: center; gap: 2px; height: 36px; border: 1px solid var(--hdr-border); border-radius: var(--radius-pill); background: var(--hdr-surface); padding: 0 4px 0 14px; line-height: 1; }
.profile-name { display: inline-flex; align-items: center; gap: 7px; height: 28px; font-size: 12px; font-weight: 600; color: var(--ink); padding-right: 10px; border-right: 1px solid var(--hdr-border); margin-right: 4px; max-width: 220px; }
.profile-name > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-name .avatar { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-grad); color: #fff; font: 700 10px/1 var(--font-display); flex-shrink: 0; }
.profile-name .role { font-family: var(--font-mono); font-size: 8.5px; line-height: 1; letter-spacing: .8px; text-transform: uppercase; color: var(--hdr-primary-ink); background: var(--hdr-primary-soft); border-radius: var(--radius-xs); padding: 3px 5px 2px; }
.tokens { display: inline-flex; align-items: center; gap: 6px; height: 28px; font-size: 11.5px; font-weight: 600; line-height: 1; color: var(--ink-2); padding: 0 10px; white-space: nowrap; }
.tokens b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.modal .tokens { font-family: var(--font-mono); font-size: 11px; font-weight: 400; color: var(--muted); }
.tokens svg { width: 14px; height: 14px; fill: none; stroke: var(--hdr-warn); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
button.tokens { border: 1px solid transparent; border-radius: var(--radius-pill); background: transparent; cursor: pointer; }
button.tokens:hover { background: var(--hdr-hover); color: var(--ink); }
.modal .kpis { grid-template-columns: 1fr 1fr; margin: 0; }
.modal .kpis div { background: var(--surface-2); box-shadow: none; }
.pbtn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border: 1px solid transparent; border-radius: var(--radius-pill); background: transparent; color: var(--ink-2); font-size: 11.5px; line-height: 1; font-weight: 600; white-space: nowrap; }
.pbtn:hover:not(:disabled) { background: var(--hdr-hover); color: var(--ink); }
.pbtn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.pbtn.key { color: var(--brand-cyan); }
.pbtn.logout:hover:not(:disabled) { color: var(--error); }
.form-section.first { margin-top: 0; }

/* ---------- Popup prozori ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .6); display: grid; place-items: center; padding: 24px; overflow-y: auto; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 28px; position: relative; overflow-y: auto; }
.modal .eyebrow { padding-right: 32px; overflow-wrap: anywhere; }
.modal h2 { margin-bottom: 4px; }
.modal .lead { color: var(--muted); font-size: 14px; margin: 8px 0 24px; }
.key-box { display: flex; gap: 8px; align-items: center; }
.key-box code { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 12px; font-size: 12.5px; color: var(--ink); letter-spacing: .3px; overflow-wrap: anywhere; user-select: all; }
.modal .close { position: absolute; top: 14px; right: 14px; }
.modal .example { margin-top: 18px; }
.modal .example p { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.modal pre { max-height: none; margin: 0; }
.modal .btn-row .tokens { padding: 0; }
.modal .tokens { font-family: var(--font-mono); font-size: 11px; font-weight: 400; color: var(--muted); }
.modal .kpis { grid-template-columns: 1fr 1fr; margin: 0; }
.modal .kpis div { background: var(--surface-2); box-shadow: none; }
.register-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.register-steps li { font-size: 13px; line-height: 1.6; color: var(--ink-2); padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.register-steps b { color: var(--ink); }
.modal a.secondary { text-decoration: none; }

/* ---------- Login / landing ---------- */
.landing { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 420px); gap: 48px; align-items: start; padding-block: 28px 56px; }
.landing-copy .eyebrow { color: var(--primary-ink); display: flex; align-items: center; gap: 8px; }
.landing-copy .eyebrow span { width: 6px; height: 6px; background: var(--brand-grad); border-radius: 50%; }
.landing-copy h1 { font-family: var(--font-display); font-size: clamp(34px, 4.2vw, 50px); font-weight: 700; line-height: 1.1; letter-spacing: -.2px; margin-bottom: 16px; }
.landing-copy h1 > span { color: var(--muted); }
.landing-lead { color: var(--ink-2); font-size: 15px; line-height: 1.7; max-width: 600px; margin: 0 0 30px; }
.login-side { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 22px; }
.login-card { padding: 32px; }
.techmind { display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 3px; padding: 20px 4px 0; border-top: 1px solid var(--border); }
.techmind .tm-logo-img { display: block; width: 190px; height: auto; margin-bottom: 2px; margin-left: auto; }
.tm-tag { font-family: var(--font-mono); font-size: 11px; letter-spacing: .03em; color: var(--muted); }
.login-card h2 { font-size: 24px; margin-bottom: 6px; }
.login-card .lead { color: var(--muted); font-size: 12.5px; margin: 0 0 22px; }
.login-card label + input { margin-bottom: 16px; }
.login-card .remember { margin-bottom: 14px; }
.login-card .primary { margin-top: 8px; }
.login-card .hint { margin-top: 16px; text-align: center; }
.login-alt { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }

/* ilustracija: dokument -> podaci */
.landing-visual { display: grid; grid-template-columns: 170px 64px minmax(0, 1fr); gap: 14px; align-items: center; margin: 0 0 34px; max-width: 620px; }
.lv-doc { position: relative; display: grid; gap: 7px; padding: 18px 16px; background: #fff; color: #1b1d26; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); transform: rotate(-3deg); aspect-ratio: 1 / 1.28; align-content: start; }
.lv-doc > span { display: block; height: 4px; border-radius: 2px; background: #cfd3dd; }
.lv-doc > span.short { width: 62%; }
.lv-doc > .lv-title { height: 7px; width: 70%; background: #3a3d48; margin-bottom: 6px; }
.lv-doc > .lv-mark { background: rgba(224, 33, 154, .35); outline: 1.5px solid rgba(224, 33, 154, .75); }
.lv-doc > .lv-mark.m1 { width: 48%; }
.lv-doc > .lv-mark.m2 { width: 80%; }
.lv-pin { position: absolute; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--brand-grad); color: #fff; font: 700 10px/1 var(--font-mono); box-shadow: var(--shadow-sm); font-style: normal; }
.lv-pin.p1 { left: -8px; top: 66px; }
.lv-pin.p2 { left: -8px; top: 112px; }
.lv-arrow { width: 64px; height: 24px; fill: none; stroke: var(--cyan); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.lv-data { display: grid; gap: 10px; padding: 16px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-md); transform: rotate(1.5deg); }
.lv-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) 56px 34px; align-items: center; gap: 10px; font-size: 11.5px; }
.lv-row em { font-style: normal; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.lv-row b { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-bar { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.lv-bar i { display: block; height: 100%; background: var(--ok); border-radius: 2px; }
.lv-bar .w96 { width: 96%; } .lv-bar .w92 { width: 92%; } .lv-bar .w89 { width: 89%; }
.lv-row small { font-family: var(--font-mono); font-size: 10px; color: var(--muted); text-align: right; }
.lv-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-family: var(--font-mono); font-size: 9.5px; color: var(--cyan); }

/* prednosti */
.landing-features { list-style: none; margin: 0 0 26px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; max-width: 680px; }
.landing-features li { display: flex; gap: 12px; align-items: flex-start; }
.landing-features svg { flex-shrink: 0; width: 34px; height: 34px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); fill: none; stroke: var(--cyan); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.landing-features b { display: block; font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.landing-features span { display: block; font-size: 12px; line-height: 1.6; color: var(--muted); }
.landing-trust { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--ink-2); }
.landing-trust span { border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 4px 11px; background: var(--surface); }
.landing-trust span::before { content: "\2713"; color: var(--ok); margin-right: 6px; }

/* registracija popup */
.register-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.register-steps li { font-size: 12.5px; line-height: 1.65; color: var(--ink-2); padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.register-steps b { color: var(--ink); }
.modal a.secondary { text-decoration: none; }

@media (max-width: 980px) {
  .landing { grid-template-columns: 1fr; gap: 28px; }
  .login-side { position: static; order: -1; }
  .landing-visual { max-width: 560px; }
}
@media (max-width: 560px) {
  .landing { padding-block: 10px 40px; }
  .landing-visual { grid-template-columns: 120px 36px minmax(0, 1fr); gap: 8px; }
  .lv-doc { padding: 12px 10px; gap: 5px; }
  .lv-arrow { width: 36px; }
  .lv-data { padding: 12px; }
  .lv-row { grid-template-columns: 56px minmax(0, 1fr) 36px 30px; gap: 6px; font-size: 10.5px; }
  .landing-features { grid-template-columns: 1fr; }
  .login-card { padding: 22px; }
}
.field-error { color: var(--error); background: var(--error-soft); border: 1px solid color-mix(in srgb, var(--error) 35%, transparent); border-radius: var(--radius); font-size: 11.5px; padding: 9px 12px; margin: 0 0 16px; }

/* ---------- Admin ---------- */
.admin-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 13px; color: var(--muted); margin: 0 0 24px; overflow-wrap: anywhere; }
.admin-nav a { color: var(--cyan); text-decoration: none; }
.admin-nav a:hover { text-decoration: underline; }
.admin-nav span::before { content: "/"; margin-right: 10px; color: var(--border-strong); }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.admin-head h1 { font-size: 30px; margin: 0; overflow-wrap: anywhere; }
.admin-head .primary { width: auto; margin: 0; padding: 11px 16px; font-size: 13px; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0 0 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--border); overflow: hidden; }
.kpis div { background: var(--surface); padding: 16px 18px; min-width: 0; }
.kpis dt { font-size: 12px; color: var(--muted); }
.kpis dd { font-size: 24px; margin: 6px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpis dd small { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); font-weight: 400; }
.table-wrap { max-width: 100%; overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 0 12px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.grid td { padding: 13px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tbody tr:hover td { background: var(--surface-2); }
table.grid .num { text-align: right; font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.grid th.num { text-align: right; }
table.grid .muted { color: var(--muted); }
table.grid td.muted { white-space: nowrap; }
table.grid .small { font-size: 12px; white-space: nowrap; }
table.grid a.user { color: var(--ink); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 9px; overflow-wrap: anywhere; }
table.grid a.user:hover { color: var(--primary-ink); }
table.grid a.user .avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); color: var(--ink-2); font-size: 12px; font-weight: 600; flex-shrink: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; border-radius: var(--radius-sm); padding: 3px 8px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.pill.admin { color: var(--primary-ink); background: var(--primary-soft); border-color: transparent; }
.pill.failed { color: var(--error); background: var(--error-soft); border-color: transparent; }
.pill.review { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.row-action { font-size: 12px; color: var(--cyan); text-decoration: none; white-space: nowrap; }
.row-action:hover { text-decoration: underline; }
.add-user { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; gap: 12px; align-items: end; margin-bottom: 24px; padding: 18px; border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius); }
.add-user label { margin-bottom: 6px; }
.add-user input[type=text] { font-family: var(--font-mono); }
.add-user .checkbox-label { height: 41px; align-items: center; font-size: 12px; color: var(--ink-2); padding: 0 6px; }
.add-user .secondary { height: 41px; white-space: nowrap; }
.user-grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.6fr); gap: 24px; align-items: start; }
.history-panel { min-height: 0; }
.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px 16px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); font-size: 12px; align-self: center; }
.kv dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
.key-field { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.key-field code { flex: 1 1 140px; min-width: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 12px; color: var(--ink); overflow-wrap: anywhere; user-select: all; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.btn-row .secondary { font-size: 12px; padding: 9px 12px; }
.btn-row .secondary.danger { color: var(--error); }
.btn-row .text-button { margin-left: auto; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.inline-form input { flex: 1 1 180px; font-family: var(--font-mono); }
.job-row { cursor: pointer; }
.job-row.open td { background: var(--surface-2); border-bottom: 0; }
.job-detail td { padding: 0 12px 16px; background: var(--surface-2); }
.job-detail .inner { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 14px 16px; }
.job-detail .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.job-detail .meta span { font-size: 12px; color: var(--ink-2); padding-right: 12px; white-space: nowrap; }
.fields-list { display: grid; gap: 8px; }
.fields-list > div { display: grid; grid-template-columns: minmax(0, 1fr) 160px 56px 120px; gap: 14px; align-items: center; font-size: 12px; }
.fields-list > div > span:first-child { overflow-wrap: anywhere; display: flex; align-items: center; gap: 6px; }
.fields-list .meter { width: 100%; height: 5px; }
.fields-list .pct { font-family: var(--font-mono); font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.fields-list .src { font-size: 12px; color: var(--muted); }
.fields-list .src.ok { color: var(--cyan); }
.fields-list .src.none { color: var(--error); }
.expander { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: 11px; transition: transform .15s; }
.job-row.open .expander { color: var(--ink); border-color: var(--border-strong); transform: rotate(90deg); }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 16px; }
.pager span b { color: var(--ink); }
.pager-buttons { display: flex; gap: 6px; }
.pager .secondary { font-size: 12px; padding: 8px 12px; }

/* ---------- Admin: Sistem (praćenje servera) ---------- */
.sys-panel { margin-bottom: 22px; }
.sys-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.sys-live { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.sys-live.ready { color: var(--ok); }
.sys-live.unavailable { color: var(--warn); }
.sys-live .pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.8s ease-in-out infinite; }
.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.segmented .seg { border: 0; background: transparent; color: var(--ink-2); font-size: 12px; font-weight: 600; padding: 6px 12px; min-width: 48px; }
.segmented .seg + .seg { border-left: 1px solid var(--border); }
.segmented .seg:hover { color: var(--ink); background: var(--surface-3); }
.segmented .seg.active { background: var(--ink); color: var(--bg); }

.sys-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.sys-tile { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 14px 16px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.sys-label { font-size: 11px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; color: var(--muted); }
.sys-value { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1; letter-spacing: -.3px; color: var(--ink); font-variant-numeric: tabular-nums; }
.sys-value small { font-family: var(--font-body); font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 5px; }
.sys-note { font-size: 11px; color: var(--muted); min-height: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fig-bar { display: block; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.fig-fill { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--chart-host); transition: width .6s ease; }
.fig-bar.gpu .fig-fill { background: var(--chart-gpu); }
.fig-fill.warn { background: var(--warn); }
.fig-fill.crit { background: var(--error); }

.sys-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.chart { margin: 0; min-width: 0; }
.chart figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.chart-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.chart-title small { font-family: var(--font-mono); font-size: 10.5px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.chart-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--ink-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--muted); flex-shrink: 0; }
.swatch.c-gpu { background: var(--chart-gpu); }
.swatch.c-host { background: var(--chart-host); }
.swatch.job { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid var(--ok); background: transparent; border-radius: 0; }
.swatch.job.failed { border-bottom-color: var(--error); }
.chart-plot { position: relative; min-height: 220px; }
.chart-wrap { position: relative; }
.chart-empty { grid-column: 1 / -1; margin: 6px 0 0; }
.tchart { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font-mono); }
.tchart .grid { stroke: var(--border); stroke-width: 1; }
.tchart .grid.vertical { stroke: var(--border-strong); }
.tchart .tick { fill: var(--muted); font-size: 10px; }
.tchart .series .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tchart .series.c-gpu .line, .tchart .series.c-gpu .dot { stroke: var(--chart-gpu); }
.tchart .series.c-host .line, .tchart .series.c-host .dot { stroke: var(--chart-host); }
.tchart .series .dot { fill: var(--surface); stroke-width: 2; }
.tchart .grad.c-gpu .stop-top { stop-color: var(--chart-gpu); stop-opacity: .22; }
.tchart .grad.c-host .stop-top { stop-color: var(--chart-host); stop-opacity: .2; }
.tchart .grad .stop-bottom { stop-color: var(--surface); stop-opacity: 0; }
.tchart .end-label { font-size: 10.5px; font-weight: 600; fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.tchart .marker { fill: var(--ok); opacity: .9; }
.tchart .marker.failed { fill: var(--error); }
.tchart .hair { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; }
.tchart .hover-dot { fill: var(--surface); stroke-width: 2; }
.tchart .hover-dot.c-gpu { stroke: var(--chart-gpu); }
.tchart .hover-dot.c-host { stroke: var(--chart-host); }
.tchart .overlay { cursor: crosshair; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 150px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg); font-size: 12px; color: var(--ink-2); }
.tip-time { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); margin-bottom: 5px; }
.tip-row { display: flex; align-items: center; gap: 7px; line-height: 1.6; }
.tip-row b { color: var(--ink); font-variant-numeric: tabular-nums; min-width: 54px; }
.tip-row.job { font-size: 11px; color: var(--muted); }

.sys-foot { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.sys-models { display: flex; flex-direction: column; gap: 8px; }
.model-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.model-chip { font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 4px 10px; }
.model-chip b { color: var(--ink); font-weight: 600; }
.sys-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.sys-meta dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); }
.sys-meta dd { margin: 2px 0 0; font-size: 12px; color: var(--ink-2); }
.chart-table { margin-top: 14px; font-size: 12px; color: var(--muted); }
.chart-table summary { cursor: pointer; }
table.grid.compact td, table.grid.compact th { padding: 7px 10px; font-size: 12px; }

@media (max-width: 1100px) { .sys-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .sys-charts { grid-template-columns: 1fr; } .sys-foot { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .sys-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sys-meta { grid-template-columns: 1fr 1fr; } .segmented .seg { min-width: 40px; padding: 6px 8px; } }

@keyframes pulse { 50% { opacity: .3; } }
@keyframes hl-in { from { transform: scale(1.15); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 1280px) { .workspace-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .result-panel { grid-column: 1 / -1; } }
@media (max-width: 900px) {
  .site-header, main, footer { max-width: none; }
  .workspace-grid, .user-grid { grid-template-columns: 1fr; }
  .result-panel { min-height: 0; }
  .document-stats, .add-user { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fields-list > div { grid-template-columns: minmax(0, 1fr) 90px 44px 100px; gap: 8px; }
}
@media (max-width: 560px) {
  .site-header, main, footer { padding-inline: 16px; }
  main { padding-block: 20px; }
  .workspace-grid, .user-grid { gap: 20px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpis div { padding: 12px; }
  .add-user { grid-template-columns: 1fr; padding: 14px; }
  .admin-head { flex-wrap: wrap; }
  .kv { grid-template-columns: 100px minmax(0, 1fr); gap: 12px; }
  .panel, .login-card { padding: 20px; }
  .panel-heading { align-items: flex-start; gap: 10px; }
  .panel-heading .tag { max-width: 115px; white-space: normal; text-align: center; }
  input[type=text], input[type=password], textarea, select { font-size: 16px; }
  .primary kbd { display: none; }
  .viewer-body { height: 360px; }
  .viewer-thumbs, .viewer.expanded .viewer-thumbs { width: 96px; padding: 8px; }
  .vthumb canvas { max-width: 100%; height: auto; }
  .viewer.expanded { inset: 6px; }
  .viewer.expanded .vbtn .vlabel { display: none; }
  .tracking-actions { flex-wrap: wrap; gap: 5px; }
  .field-top { flex-wrap: wrap; gap: 8px; }
  .chip > span:first-child { max-width: 150px; }
  .options-row { grid-template-columns: 1fr; gap: 0; }
  .result-actions .secondary { flex: 1; padding: 10px; }
  .result-actions .text-button { margin: 5px 0 0; }
  .modal-backdrop { padding: 12px; }
  .modal { padding: 20px; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
}
@media (max-width: 560px) {
  .site-header { padding-block: 16px; gap: 12px; }
  .header-actions { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
  .quiet-link { font-size: 11px; }
  .brand { font-size: 21px; }
  .profile { padding-left: 8px; } .profile .tokens { display: none; } .pbtn .label, .tokens .label { display: none; } .pbtn { padding: 0 8px; }
}
