/* =========================================================
   MEMODOK Izveštaji — dizajn usklađen sa www.memodok.rs
   (plava tema logotipa, Montserrat za naslove, Inter za tekst)
   ========================================================= */
@font-face { font-family: "Inter"; src: url("fonts/Inter-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-SemiBold.ttf") format("truetype"); font-weight: 500 700; font-display: swap; }

:root {
  --navy-950: #071631;
  --navy-900: #0a1f44;
  --navy-800: #0e2a5a;
  --brand: #0b3a75;
  --brand-600: #082c5a;
  --brand-50: #edf2f9;
  --brand-100: #d5e0ef;
  --sky: #9cd0ff;
  --ink: #10213f;
  --text: #1b2a44;
  --muted: #5a6a85;
  --line: #e1e7f0;
  --bg: #f4f7fc;
  --panel: #ffffff;
  --link: #1556b0;
  --neg: #b42318;
  --ok: #067647;
  --warn: #b54708;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(10, 31, 68, .06);
  --shadow-lg: 0 10px 30px rgba(10, 31, 68, .12);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Montserrat", var(--font);
  --tabbar-h: 64px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased;
       min-height: 100vh; min-height: 100dvh; -webkit-tap-highlight-color: rgba(11, 58, 117, .12); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--navy-900); letter-spacing: -.01em; line-height: 1.2; }
h1 { font-size: 24px; margin: 0 0 4px; font-weight: 700; }
h3 { font-size: 16px; margin: 22px 0 8px; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.neg { color: var(--neg); }
.inline { display: inline; }
.mono { font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; font-size: 12.5px; }
.strong { font-weight: 600; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* ---------- dugmad i polja ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px;
       border-radius: var(--radius); border: 1.5px solid var(--line); background: #fff; color: var(--navy-900);
       font: 600 14px/1.2 var(--font-head); letter-spacing: .01em; cursor: pointer; white-space: nowrap; text-decoration: none !important;
       transition: background .15s, border-color .15s, box-shadow .15s, color .15s; }
.btn:hover { background: var(--bg); border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); border-color: var(--brand-600); box-shadow: 0 8px 20px rgba(11, 58, 117, .25); }
.btn.danger { color: var(--neg); border-color: #f4c7c3; }
.btn.danger:hover { background: #fef3f2; border-color: var(--neg); }
.btn.block { width: 100%; }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
input, select, textarea { font: 15px/1.3 var(--font); color: var(--ink); padding: 9px 12px; min-height: 42px; border: 1.5px solid #d3dbe7;
       border-radius: 10px; background: #fff; width: 100%; -webkit-appearance: none; appearance: none; }
select { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a6a85' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px;
         padding-right: 34px; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; padding: 0; border-radius: 5px; flex: none; -webkit-appearance: checkbox; appearance: auto; accent-color: var(--brand); }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(21, 86, 176, .18); border-color: var(--brand); }
label.check { flex-direction: row; align-items: center; gap: 9px; color: var(--ink); font-size: 14px; font-weight: 400; cursor: pointer; }
.alert { background: #fef3f2; border: 1px solid #fecdca; color: var(--neg); padding: 10px 14px; border-radius: 10px; margin: 8px 0; }
.ok { background: #ecfdf3; border: 1px solid #abefc6; color: var(--ok); padding: 10px 14px; border-radius: 10px; margin: 8px 0; }
.tag { display: inline-block; font: 600 10.5px/1.6 var(--font); text-transform: uppercase; letter-spacing: .06em; padding: 1px 8px;
       border-radius: 999px; background: var(--brand-50); color: var(--brand); }
.tag-admin { background: #fef0c7; color: #93370d; }

/* ---------- zaglavlje aplikacije ---------- */
.appbar { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line);
          padding-top: var(--safe-t); backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px); }
.appbar-inner { display: flex; align-items: center; gap: 20px; min-height: 66px; padding: 8px max(20px, var(--safe-r)) 8px max(20px, var(--safe-l)); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none !important; flex: none; }
.brand img { height: 36px; width: auto; display: block; }
.brand .mark { display: none; }
.brand-app { font: 700 11px/1 var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: var(--brand);
             background: var(--brand-50); padding: 6px 10px; border-radius: 999px; }
.ctx { display: flex; gap: 10px; align-items: center; flex: 1; min-width: 0; }
.ctx label { flex-direction: row; align-items: center; gap: 8px; font-size: 12px; white-space: nowrap; }
.ctx label.grow { flex: 1; max-width: 560px; min-width: 0; }
.ctx select { min-height: 38px; font-size: 14px; font-weight: 500; background-color: var(--bg); border-color: transparent; }
.ctx select:hover { border-color: var(--brand-100); }
.who { display: flex; align-items: center; gap: 10px; font-size: 13.5px; white-space: nowrap; }
.who .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center;
               font: 700 13px/1 var(--font-head); flex: none; }
.who .name { font-weight: 600; color: var(--ink); max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.linkbtn { background: none; border: 1.5px solid var(--line); color: var(--navy-900); border-radius: 10px; padding: 7px 12px; cursor: pointer;
           font: 600 13px/1 var(--font-head); }
.linkbtn:hover { border-color: var(--brand); background: var(--bg); }

/* ---------- raspored ---------- */
.layout { display: flex; align-items: flex-start; }
.side { position: sticky; top: 67px; width: 248px; flex: none; height: calc(100vh - 67px); height: calc(100dvh - 67px); overflow-y: auto;
        padding: 18px 12px 24px; border-right: 1px solid var(--line); background: #fff; }
.side h4 { font: 700 10.5px/1 var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: #8a97ad; margin: 20px 12px 8px; }
.side h4:first-child { margin-top: 4px; }
.side a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--ink); font-weight: 500; font-size: 14px; }
.side a svg { width: 18px; height: 18px; color: #7b8aa3; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.side a:hover { background: var(--bg); text-decoration: none; }
.side a.active { background: var(--brand-50); color: var(--brand-600); font-weight: 600; }
.side a.active svg { color: var(--brand); }
.side .site-link { margin-top: 18px; border: 1.5px dashed var(--brand-100); color: var(--brand); }
.content { flex: 1; min-width: 0; padding: 26px 30px 48px; }
.bare { min-height: 100vh; min-height: 100dvh; }

/* ---------- prijava ---------- */
.login-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
              padding: calc(24px + var(--safe-t)) max(16px, var(--safe-r)) calc(24px + var(--safe-b)) max(16px, var(--safe-l));
              position: relative; overflow: hidden;
              background: radial-gradient(900px 520px at 88% 0%, rgba(56, 189, 248, .16), transparent 60%),
                          radial-gradient(800px 500px at 10% 100%, rgba(29, 100, 216, .10), transparent 60%),
                          linear-gradient(180deg, #fbfdff, #eef4fc); }
.login-page::before { content: ""; position: absolute; inset: 0; pointer-events: none;
                      background-image: radial-gradient(rgba(11, 58, 117, .08) 1px, transparent 1px); background-size: 22px 22px;
                      -webkit-mask-image: radial-gradient(ellipse 70% 80% at 80% 20%, #000 15%, transparent 72%);
                      mask-image: radial-gradient(ellipse 70% 80% at 80% 20%, #000 15%, transparent 72%); }
.login { position: relative; width: 100%; max-width: 410px; background: #fff; border: 1px solid var(--line); border-radius: 18px;
         box-shadow: var(--shadow-lg); padding: 34px 32px 28px; display: flex; flex-direction: column; gap: 14px; }
.login .logo { width: 220px; max-width: 70%; height: auto; display: block; margin: 0 auto 6px; }
.login h1 { text-align: center; font-size: 21px; margin: 6px 0 0; }
.login .lead { text-align: center; color: var(--muted); margin: -6px 0 6px; font-size: 14px; }
.login .btn { min-height: 48px; font-size: 15px; margin-top: 4px; }
.login-foot { position: relative; margin-top: 22px; font-size: 13px; color: var(--muted); text-align: center; }
.login-foot a { font-weight: 600; }

/* ---------- početna ---------- */
.hello { position: relative; overflow: hidden; border-radius: 16px; padding: 26px 28px; margin-bottom: 18px; color: #fff;
         background: radial-gradient(600px 300px at 90% 0%, rgba(156, 208, 255, .28), transparent 60%), linear-gradient(135deg, #0e2a5a, #0b3a75 55%, #1556b0); }
.hello::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.10) 1px, transparent 1px);
                background-size: 20px 20px; -webkit-mask-image: linear-gradient(90deg, transparent 40%, #000); mask-image: linear-gradient(90deg, transparent 40%, #000); pointer-events: none; }
.hello > * { position: relative; z-index: 1; }
.hello .eyebrow { font: 700 11px/1 var(--font-head); letter-spacing: .16em; text-transform: uppercase; color: var(--sky); }
.hello h1 { color: #fff; font-size: 26px; margin: 8px 0 6px; }
.hello p { margin: 0; color: #d4e2f5; }
.hello .stats { display: flex; gap: 26px; margin-top: 18px; flex-wrap: wrap; }
.hello .stats b { display: block; font: 700 22px/1.1 var(--font-head); color: #fff; }
.hello .stats span { font-size: 12.5px; color: #b9cbe6; }
.section-title { font: 700 12px/1 var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: #8a97ad; margin: 24px 2px 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tile { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px;
        color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.tile:hover { border-color: var(--brand-100); box-shadow: var(--shadow-lg); text-decoration: none; transform: translateY(-1px); }
.tile .ti { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; flex: none; }
.tile .ti svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tile b { display: block; font: 700 15px/1.3 var(--font-head); color: var(--navy-900); }
.tile span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.tile.red .ti { background: #fef3f2; color: var(--neg); }
.site-card { display: flex; align-items: center; gap: 18px; margin-top: 22px; padding: 18px 20px; border-radius: 14px; background: #fff;
             border: 1px solid var(--line); flex-wrap: wrap; }
.site-card img { height: 34px; width: auto; }
.site-card p { margin: 0; flex: 1; min-width: 200px; color: var(--muted); font-size: 14px; }

/* ---------- filteri i alati ---------- */
.pagehead { margin-bottom: 16px; }
.pagehead.row, .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; background: #fff; border: 1px solid var(--line);
           border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.filters label { min-width: 150px; }
.filters label.grow { flex: 1; min-width: 280px; max-width: 620px; }
.filters .spacer { flex: 1; }
.filters label.check { align-self: center; min-width: 0; }
.doc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tablefilter { margin: 0 0 12px; max-width: 380px; padding-left: 36px;
               background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a6a85' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center / 17px; }
.placeholder { background: #fff; border: 1.5px dashed #c8d3e3; border-radius: 14px; padding: 44px 20px; text-align: center; color: var(--muted); }

/* ---------- pretraga komitenta (combobox) ---------- */
.combo { position: relative; }
.combo-input { padding-left: 38px; padding-right: 38px;
               background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a6a85' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center / 18px; }
.combo-clear { position: absolute; right: 4px; bottom: 4px; width: 34px; height: 34px; border: 0; background: none; color: var(--muted);
               font-size: 20px; line-height: 1; cursor: pointer; border-radius: 8px; }
.combo-clear:hover { background: var(--bg); }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
              background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
              max-height: min(380px, 55vh); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.combo-list li { display: flex; align-items: baseline; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); font-size: 14px; }
.combo-list li .c-sif { font-family: Consolas, ui-monospace, monospace; font-size: 12.5px; color: var(--muted); flex: none; min-width: 58px; }
.combo-list li .c-naz { flex: 1; min-width: 0; }
.combo-list li.active, .combo-list li:hover { background: var(--brand-50); }
.combo-list li.sel .c-naz { font-weight: 600; color: var(--brand); }
.combo-list mark { background: #fff1b8; color: inherit; border-radius: 3px; padding: 0 1px; }
.combo-list .c-empty, .combo-list .c-more { color: var(--muted); cursor: default; font-size: 13px; }
.combo-list .c-empty:hover, .combo-list .c-more:hover { background: none; }

/* ---------- tabele ---------- */
.tablewrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; -webkit-overflow-scrolling: touch; }
table.report { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.report th { text-align: left; font-weight: 600; background: #f7f9fc; border-bottom: 1px solid var(--line); padding: 10px 12px; white-space: nowrap; color: var(--muted); font-size: 12.5px; }
.report td { padding: 8px 12px; border-bottom: 1px solid #edf1f6; vertical-align: top; }
.report tbody tr:hover { background: #f7faff; }
.report .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.report tfoot td { font-weight: 700; background: #f7f9fc; border-top: 2px solid var(--line); }
.report tr.sub td { background: #f7f9fc; font-style: italic; color: var(--muted); }
.report .empty { text-align: center; color: var(--muted); padding: 28px; }
.report tr.negrow td { color: var(--neg); }
.report td.hot { color: var(--neg); font-weight: 600; }
.st { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #f2f4f7; color: #475467; white-space: nowrap; }
.st-due { background: #fef3f2; color: var(--neg); }
.st-ok { background: #ecfdf3; color: var(--ok); }
.st-up { background: var(--brand-50); color: var(--brand); }

/* ---------- dokument (izveštaj) ---------- */
.doc { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 30px 34px 20px; max-width: 1200px; }
.doc.doc-wide { max-width: none; }
.doc-head { display: flex; justify-content: space-between; gap: 28px; padding-bottom: 18px; margin-bottom: 20px; border-bottom: 3px solid var(--brand); flex-wrap: wrap; }
.doc-firm { font-size: 13px; color: var(--muted); line-height: 1.55; }
.doc-firm-name { font: 700 17px/1.3 var(--font-head); color: var(--navy-900); margin-bottom: 3px; }
.doc-title { text-align: right; margin-left: auto; }
.doc-kicker { font: 700 10.5px/1 var(--font-head); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.doc-title h1 { font-size: 27px; font-weight: 800; color: var(--brand); margin: 6px 0 10px; }
.doc-meta { display: grid; grid-template-columns: auto auto; gap: 2px 14px; margin: 0; justify-content: end; font-size: 13px; }
.doc-meta dt { color: var(--muted); text-align: right; }
.doc-meta dd { margin: 0; font-weight: 600; text-align: right; color: var(--ink); }
.doc-party { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; margin-bottom: 16px; font-size: 13.5px; line-height: 1.55; }
.doc-party-label { font: 700 10.5px/1.4 var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.doc-party-name { font: 700 16px/1.35 var(--font-head); color: var(--navy-900); display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.blok-live { display: inline-flex; align-items: center; gap: 3px; font: 400 13px/1.3 var(--font); color: var(--text); }
.blok-live.checking .tacka::before { animation: vrti 1s linear infinite; border-style: dashed; background: none !important; }
.doc-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 18px; overflow: hidden; }
.doc-sum { padding: 12px 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.doc-sum:last-child { border-right: 0; }
.doc-sum span { font-size: 12px; color: var(--muted); }
.doc-sum b { font: 700 19px/1.2 var(--font-head); font-variant-numeric: tabular-nums; color: var(--navy-900); letter-spacing: -.01em; }
.doc-sum b.neg { color: var(--neg); }
.doc-sum em { font-style: normal; font-size: 12px; color: var(--muted); }
.doc-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.doc .report th { background: var(--brand); color: #fff; border: 0; font-size: 12.5px; }
.doc .report th:first-child { border-top-left-radius: 8px; }
.doc .report th:last-child { border-top-right-radius: 8px; }
.doc .report tbody tr:nth-child(even) { background: #fafbfd; }
.doc .report tbody tr:hover { background: #f0f5fc; }
.doc .report tfoot td { background: var(--brand-50); border-top: 2px solid var(--navy-900); color: var(--navy-900); }
.doc-note { font-size: 12px; color: var(--muted); margin: 12px 0 0; }
.doc-foot { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); margin-top: 24px; padding-top: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.doc-brand { color: var(--brand); font: 700 12.5px/1.3 var(--font-head); letter-spacing: .02em; }
.doc-confirm { margin-top: 28px; font-size: 13.5px; line-height: 1.65; page-break-inside: avoid; }
.doc-confirm .sig { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 48px; margin-top: 24px; }
.doc-confirm .sig div { display: flex; flex-direction: column; font-size: 12.5px; color: var(--muted); }
.doc-confirm .sig i { display: block; border-bottom: 1px solid var(--ink); height: 36px; }
.doc-confirm .sig small { margin-top: 3px; }
.dotcol { width: 32px; text-align: center; padding-left: 6px !important; padding-right: 0 !important; }

/* ---------- blokade (NBS) ---------- */
.tacka { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
         display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; font-style: normal; }
.tacka:hover, .tacka:focus-visible { background: rgba(16, 24, 40, .08); outline: 0; }
.tacka::before { content: ""; width: 11px; height: 11px; border-radius: 999px; border: 2px solid #98a2b3; box-sizing: border-box; }
.tacka.nema::before, .tacka.neupisan::before { background: #2e7d32; border-color: #2e7d32; }
.tacka.ranije::before { background: #ef6c00; border-color: #ef6c00; }
.tacka.blokiran::before { background: #ba1a1a; border-color: #ba1a1a; animation: bljesak 1s steps(1) infinite; }
.tacka.greska::before { border-style: dashed; }
@keyframes bljesak { 50% { opacity: .15; } }
@keyframes vrti { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tacka.blokiran::before { animation: none; } }
.nbs-pop { position: absolute; z-index: 60; max-width: 310px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
           box-shadow: var(--shadow-lg); padding: 12px 14px; font-size: 13px; line-height: 1.5; }
.nbs-pop-title { font: 700 13.5px/1.3 var(--font-head); color: var(--navy-900); margin-bottom: 4px; }
.nbs-pop ul { margin: 2px 0 0; padding-left: 18px; }
.nbs-pop .mt { margin-top: 4px; }
.nbsbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: -2px 0 14px; }
.legend { display: inline-flex; align-items: center; gap: 2px 6px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend .tacka { cursor: default; width: 18px; }
.legend .tacka:hover { background: none; }
.legend .tacka::before { animation: none !important; }
.nbs-progress { display: flex; align-items: center; gap: 12px; min-width: 260px; flex: 1; }
.nbs-bar { flex: 1; max-width: 320px; height: 7px; background: #e6ebf3; border-radius: 99px; overflow: hidden; }
.nbs-bar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.running .nbs-run svg { animation: vrti 1s linear infinite; }

/* ---------- administracija ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: var(--shadow); }
.form { display: flex; flex-direction: column; gap: 14px; max-width: 920px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checks { display: flex; gap: 24px; flex-wrap: wrap; }
.poscheck { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 2px 14px; max-height: 440px; overflow: auto;
            border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-top: 8px; -webkit-overflow-scrolling: touch; }
.posrow { padding: 6px; border-radius: 8px; }
.posrow:hover { background: var(--bg); }
.code { font-family: Consolas, monospace; background: var(--brand-50); color: var(--brand); padding: 0 6px; border-radius: 5px; font-size: 12.5px; }
#poslist.disabled { opacity: .45; pointer-events: none; }
.chip { display: inline-block; background: var(--brand-50); color: var(--brand); border-radius: 999px; padding: 1px 9px; margin: 1px; font-size: 12px; }
.actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.danger { margin-top: 16px; }

/* ---------- mobilna navigacija (skrivena na računaru) ---------- */
.tabbar, .sheet, .sheet-backdrop { display: none; }
.install { position: fixed; z-index: 70; left: max(12px, var(--safe-l)); right: max(12px, var(--safe-r));
           bottom: calc(var(--tabbar-h) + 12px + var(--safe-b)); display: flex; align-items: center; gap: 12px; padding: 12px 44px 12px 12px;
           background: var(--navy-900); color: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); font-size: 14px; line-height: 1.4; }
.install img { width: 46px; height: 46px; border-radius: 11px; flex: none; }
.install p { margin: 0; flex: 1; }
.install b { font-family: var(--font-head); }
.install .ios-share { width: 18px; height: 18px; vertical-align: -3px; fill: none; stroke: var(--sky); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.install .zatvori { position: absolute; top: 4px; right: 4px; width: 38px; height: 38px; background: none; border: 0; color: #a9b8d0; font-size: 24px; line-height: 1; cursor: pointer; }
.install .btn { flex: none; background: #fff; border-color: #fff; color: var(--navy-900); }
.login-page ~ .install, body.bare-page .install { bottom: calc(16px + var(--safe-b)); }

/* =========================================================
   TELEFON (do 760 px) — posebna pažnja za iPhone:
   zaglavlje nije zalepljeno, fiksna je samo donja traka,
   svi razmaci poštuju safe-area, polja su 16px (bez zumiranja)
   ========================================================= */
@media (max-width: 760px) {
  body { font-size: 15px; }
  body.app { padding-bottom: calc(var(--tabbar-h) + var(--safe-b)); }
  input, select, textarea { font-size: 16px; min-height: 46px; }
  .btn { min-height: 46px; }

  .appbar { position: static; backdrop-filter: none; -webkit-backdrop-filter: none; background: #fff; }
  .appbar-inner { flex-wrap: wrap; gap: 10px 12px; min-height: 0; padding: 10px max(14px, var(--safe-r)) 10px max(14px, var(--safe-l)); }
  .brand img.full { display: none; }
  .brand .mark { display: block; height: 34px; }
  .brand-app { font-size: 10.5px; }
  .who { margin-left: auto; }
  .who .name, .who form { display: none; }
  .ctx { order: 3; flex: 1 1 100%; gap: 8px; }
  .ctx label { gap: 0; }
  .ctx label span { display: none; }
  .ctx label:first-child { flex: none; width: 96px; }
  .ctx label.grow { max-width: none; }
  .ctx select { min-height: 44px; font-size: 16px; background-color: var(--bg); }

  .layout { display: block; }
  .side { display: none; }
  .content { padding: 14px max(12px, var(--safe-r)) 24px max(12px, var(--safe-l)); }
  h1 { font-size: 21px; }

  /* donja traka sa tabovima */
  .tabbar { display: flex; position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, .98);
            border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(10, 31, 68, .06);
            padding: 4px max(6px, var(--safe-r)) calc(4px + var(--safe-b)) max(6px, var(--safe-l)); }
  .tabbar a, .tabbar button { flex: 1 1 0; min-width: 0; height: calc(var(--tabbar-h) - 8px); display: flex; flex-direction: column; align-items: center;
            justify-content: center; gap: 3px; border: 0; background: none; border-radius: 12px; color: var(--muted);
            font: 600 10.5px/1.1 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; text-decoration: none !important; }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar .active { color: var(--brand); background: var(--brand-50); }

  /* donji panel „Više“ */
  .sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 80; background: rgba(7, 22, 49, .45); opacity: 0; pointer-events: none; transition: opacity .2s; touch-action: none; }
  .sheet { display: block; position: fixed; z-index: 90; left: 0; right: 0; bottom: 0; max-height: 82vh; max-height: 82dvh; overflow-y: auto;
           overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: #fff; border-radius: 20px 20px 0 0;
           padding: 8px max(14px, var(--safe-r)) calc(16px + var(--safe-b)) max(14px, var(--safe-l));
           transform: translateY(105%); transition: transform .25s ease; box-shadow: 0 -10px 30px rgba(10, 31, 68, .2); }
  .sheet-open .sheet { transform: none; }
  .sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }
  .sheet .grip { width: 40px; height: 5px; border-radius: 99px; background: #d3dbe7; margin: 4px auto 10px; }
  .sheet h4 { font: 700 10.5px/1 var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: #8a97ad; margin: 16px 6px 6px; }
  .sheet a, .sheet button.item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 10px; border-radius: 12px; color: var(--ink);
           font: 500 16px/1.2 var(--font); border: 0; background: none; text-align: left; text-decoration: none !important; }
  .sheet a svg, .sheet button.item svg { width: 22px; height: 22px; color: var(--brand); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .sheet a.active { background: var(--brand-50); color: var(--brand-600); font-weight: 600; }
  .sheet .user-row { display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--bg); border-radius: 14px; margin-top: 6px; }
  .sheet .user-row b { display: block; }

  /* filteri */
  .filters { padding: 12px; gap: 10px; border-radius: 14px; }
  .filters label, .filters label.grow { flex: 1 1 100%; min-width: 0; max-width: none; }
  .filters label.half { flex: 1 1 calc(50% - 5px); }
  .filters > .btn.primary { flex: 1 1 100%; }
  .filters .spacer { display: none; }
  .filters .doc-actions { flex: 1 1 100%; }
  .filters .doc-actions .btn { flex: 1 1 0; padding: 8px 6px; }
  .nbsbar { gap: 8px; }
  .nbsbar .nbs-run { width: 100%; }
  .nbs-progress { min-width: 0; flex: 1 1 100%; }
  .tablefilter { max-width: none; }

  /* dokument */
  .doc { padding: 16px 14px 12px; border-radius: 14px; }
  .doc-head { gap: 12px; padding-bottom: 12px; margin-bottom: 14px; }
  .doc-title { text-align: left; margin-left: 0; order: -1; width: 100%; }
  .doc-title h1 { font-size: 22px; margin: 4px 0 8px; }
  .doc-meta { justify-content: start; grid-template-columns: auto 1fr; }
  .doc-meta dt, .doc-meta dd { text-align: left; }
  .doc-firm { font-size: 12.5px; }
  .doc-firm-name { font-size: 14.5px; }
  .doc-summary { grid-template-columns: 1fr 1fr; }
  .doc-sum { border-bottom: 1px solid var(--line); padding: 10px 12px; }
  .doc-sum:nth-child(2n) { border-right: 0; }
  .doc-sum b { font-size: 16.5px; }
  .doc-confirm .sig { grid-template-columns: 1fr; }
  .doc-foot { flex-direction: column; gap: 2px; }

  /* tabele → kartice; nazive kolona u data-label upisuje app.js */
  table.report, .report tbody, .report tfoot { display: block; }
  .report thead { display: none; }
  .report tr { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; background: #fff !important;
               border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; margin-bottom: 8px; }
  .report td { display: block; padding: 0; border: 0; text-align: left !important; white-space: normal; min-width: 0; font-size: 14px; }
  .report td:empty { display: none; }
  .report td[data-label]::before { content: attr(data-label); display: block; font: 600 10.5px/1.4 var(--font); text-transform: uppercase; letter-spacing: .05em; color: #8a97ad; }
  .report td.title { grid-column: 1 / -1; order: -2; font: 600 15px/1.35 var(--font-head); color: var(--navy-900); padding-right: 28px; }
  .report td.title::before, .report td.dotcol::before, .report td.wide::before { display: none; }
  .report td.wide { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
  .report td.dotcol { position: absolute; top: 7px; right: 6px; width: auto; padding: 0 !important; }
  .report td.num { font-variant-numeric: tabular-nums; }
  .report td.empty { grid-column: 1 / -1; text-align: center !important; }
  .report tr.sub { background: var(--bg) !important; }
  .report tfoot tr { background: var(--brand-50) !important; border-color: var(--brand-100); }
  .report tfoot td:first-child { grid-column: 1 / -1; color: var(--navy-900); }
  .report tfoot td:first-child::before { display: none; }
  .doc .report tfoot td { border: 0; background: none; }
  .report .noprint:empty { display: none; }

  .poshead, .grid2 { grid-template-columns: 1fr; }
  .poscheck { grid-template-columns: 1fr; max-height: 55vh; }
  .hello { padding: 20px 18px; border-radius: 14px; }
  .hello .stats { gap: 18px; }
  .hello .stats b { font-size: 19px; }
  .hello h1 { font-size: 21px; }
  .tiles { grid-template-columns: 1fr; gap: 8px; }
  .tile { padding: 13px 14px; }

  .nbs-pop { position: fixed !important; left: 0 !important; right: 0; top: auto !important; bottom: 0; max-width: none; border-radius: 18px 18px 0 0;
             padding: 16px max(16px, var(--safe-r)) calc(18px + var(--safe-b)) max(16px, var(--safe-l)); font-size: 14.5px; z-index: 95; }
  .login { padding: 26px 20px 22px; border-radius: 16px; }
}
@media (min-width: 761px) {
  .install { left: auto; right: 24px; bottom: 24px; max-width: 430px; }
}

/* ---------- štampa ---------- */
.printonly { display: none; }
@page { size: A4; margin: 12mm 11mm 16mm; }
@media print {
  .appbar, .side, .noprint, .tablefilter, .btn, .nbsbar, .placeholder, .nbs-pop, .tabbar, .sheet, .sheet-backdrop, .install { display: none !important; }
  body { background: #fff; font-size: 11px; padding: 0 !important; }
  .content { padding: 0; }
  .layout { display: block; }
  .doc { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .doc-head, .doc .report th, .doc .report tfoot td, .doc-party, .tacka::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc .report thead { display: table-header-group; }
  .doc .report tr { page-break-inside: avoid; }
  .report td, .report th { padding: 3px 6px; }
  .doc-foot { position: fixed; left: 0; right: 0; bottom: -10mm; margin: 0; background: #fff; }
  .tacka.blokiran::before { animation: none; }
  .doc-title h1 { font-size: 20px; }
  .doc-sum b { font-size: 14px; }
  a { color: inherit; }
}
