@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage.woff") format("woff"); font-weight: 600 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("fonts/public-sans.woff") format("woff"); font-weight: 400 700; font-style: normal; font-display: swap; }
/* Temelino — boje iz loga: škriljevac + bakreni krov */
:root {
  --paper: #ECEEEA;
  --surface: #FFFFFF;
  --surface-2: #F5F6F3;
  --ink: #26323A;
  --ink-2: #4A565B;
  --ink-3: #7D888C;
  --line: #D6DAD5;
  --steel: #2F5D73;
  --steel-soft: #DCE8EE;
  --hivis: #DA6243;
  --hivis-ink: #FFFFFF;
  --ok: #2E7D4F;
  --ok-soft: #DDEFE3;
  --warn: #B86E00;
  --warn-soft: #FBEBCF;
  --bad: #C2412D;
  --bad-soft: #F8E0DB;
  --plan: #8A9AA0;
  --side: #283543;
  --side-ink: #C9D2D5;
  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 18px;
  --shadow: 0 1px 0 rgba(30, 39, 43, .06), 0 6px 20px -12px rgba(30, 39, 43, .25);
  --font-head: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Public Sans", "Segoe UI", system-ui, sans-serif;
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131A1D; --surface: #1B2427; --surface-2: #212C30; --ink: #E6ECEE; --ink-2: #AFBBBF; --ink-3: #7D8A8F;
    --line: #2E3A3F; --steel: #7FB3CC; --steel-soft: #20333C; --ok: #5DBB83; --ok-soft: #183327; --warn: #E3A13A; --warn-soft: #3A2C14;
    --bad: #EB7A66; --bad-soft: #3D1E19; --plan: #6C7C82; --side: #0E1416; --shadow: 0 1px 0 rgba(0,0,0,.3), 0 8px 24px -14px rgba(0,0,0,.7); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #131A1D; --surface: #1B2427; --surface-2: #212C30; --ink: #E6ECEE; --ink-2: #AFBBBF; --ink-3: #7D8A8F;
  --line: #2E3A3F; --steel: #7FB3CC; --steel-soft: #20333C; --ok: #5DBB83; --ok-soft: #183327; --warn: #E3A13A; --warn-soft: #3A2C14;
  --bad: #EB7A66; --bad-soft: #3D1E19; --plan: #6C7C82; --side: #0E1416; --shadow: 0 1px 0 rgba(0,0,0,.3), 0 8px 24px -14px rgba(0,0,0,.7); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75em; }
a { color: var(--steel); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--hivis); outline-offset: 2px; }

/* ---------- Okvir ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
.side { display: none; }
.main { padding: 16px 16px calc(var(--nav-h) + 32px + env(safe-area-inset-bottom)); max-width: 1180px; margin: 0 auto; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); background: var(--paper); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .proj-switch { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px 0; text-align: left; cursor: pointer; }
.proj-switch svg { width: 18px; height: 18px; flex: none; color: var(--ink-3); }
.proj-switch .pname { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo-mark { width: 32px; height: 32px; flex: none; border-radius: 8px; }
.topbar .spacer { display: none; flex: 1; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); flex: none; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg, .nav-item svg, .btn svg { width: 22px; height: 22px; }

.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: var(--surface); border-top: 1px solid var(--line); height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .72rem; color: var(--ink-3); text-decoration: none; padding: 6px 0; font-weight: 600; }
.nav-item.active { color: var(--ink); }
.nav-item.active svg { color: var(--steel); }
.nav-add { justify-self: center; width: 58px; height: 58px; border-radius: 18px; background: var(--hivis); color: var(--hivis-ink); border: 0; display: grid; place-items: center; cursor: pointer; transform: translateY(-14px);
  box-shadow: 0 6px 16px -6px rgba(150, 80, 50, .55); }
.nav-add svg { width: 28px; height: 28px; }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 252px 1fr; }
  .side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; background: var(--side); color: var(--side-ink); padding: 18px 12px; overflow-y: auto; }
  .side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: #fff; font-family: var(--font-head); font-size: 1.35rem; font-weight: 800; text-decoration: none; }
  .side .proj-pick { margin: 0 4px 14px; padding: 10px 12px; border-radius: var(--radius); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); color: #fff; text-align: left; cursor: pointer; }
  .side .proj-pick small { display: block; color: var(--side-ink); opacity: .7; font-size: .75rem; }
  .side .proj-pick b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius-s); color: var(--side-ink); text-decoration: none; font-weight: 500; }
  .side nav a svg { width: 20px; height: 20px; opacity: .8; }
  .side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
  .side nav a.active { background: rgba(218, 98, 67, .2); color: #fff; box-shadow: inset 3px 0 0 var(--hivis); }
  .side .side-add { margin: 0 4px 16px; }
  .side .side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 8px; font-size: .85rem; }
  .side .side-foot a { color: var(--side-ink); }
  .side .side-foot svg { width: 18px; height: 18px; flex: none; }
  .bottom-nav { display: none; }
  .topbar .proj-switch, .topbar .logo-mark { display: none; }
  .topbar .spacer { display: block; }
  .topbar { padding: 14px 32px; }
  .main { padding: 8px 32px 48px; }
}

/* ---------- Gumbi i forme ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-primary:hover { opacity: .92; border-color: var(--ink); }
.btn-hivis { background: var(--hivis); border-color: var(--hivis); color: var(--hivis-ink); }
.btn-danger { color: var(--bad); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .875rem; border-radius: var(--radius-s); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.input, .field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 10px 12px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface); }
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: 2px solid var(--steel); outline-offset: 0; border-color: var(--steel); }
.field-amount input { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; min-height: 60px; font-variant-numeric: tabular-nums; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.hint { font-size: .8rem; color: var(--ink-3); margin-top: 4px; }
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 3px; gap: 3px; }
.seg label { flex: 1; text-align: center; position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; left: 0; top: 0; width: 1px; height: 1px; margin: 0; }
.seg span { display: block; padding: 9px 6px; border-radius: 7px; font-weight: 600; font-size: .9rem; cursor: pointer; color: var(--ink-2); }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 3px solid var(--hivis); }
details.more { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 8px; }
details.more > summary { cursor: pointer; font-weight: 600; color: var(--steel); padding: 8px 0; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+ "; }
details.more[open] > summary::before { content: "− "; }
.check { display: flex; align-items: center; gap: 10px; margin: 8px 0 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--steel); }

/* ---------- Kartice / blokovi ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 18px; }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-head a { font-size: .9rem; font-weight: 600; text-decoration: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 18px; }
.page-head p { margin: 4px 0 0; color: var(--ink-3); }
.cols { display: grid; gap: 16px; }
@media (min-width: 1000px) { .cols { grid-template-columns: 1.4fr 1fr; align-items: start; } .cols > .panel + .panel { margin-top: 0; } }
.stack > * + * { margin-top: 16px; }

/* ---------- Budžet "metar" (signature) ---------- */
.hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 20px 18px 18px; margin-bottom: 16px; position: relative; overflow: hidden; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.hero .big { font-family: var(--font-head); font-size: clamp(2.1rem, 1.6rem + 2.4vw, 3.2rem); font-weight: 800; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hero .big small { font-size: .45em; font-weight: 600; color: var(--ink-3); letter-spacing: 0; margin-left: 4px; }
.hero .sub { color: var(--ink-2); margin-top: 6px; }
.hero .badge-left { text-align: right; }
.tape { margin: 22px 0 6px; }
.tape-bar { position: relative; height: 34px; border-radius: 4px; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), var(--line) calc(10% - 1px) 10%), var(--surface-2); border: 1px solid var(--line); overflow: hidden; display: flex; }
.tape-bar .seg-paid { background: var(--ink); }
.tape-bar .seg-unpaid { background: repeating-linear-gradient(-45deg, var(--warn) 0 6px, color-mix(in srgb, var(--warn) 70%, var(--surface)) 6px 12px); }
.tape-bar .seg-plan { background: repeating-linear-gradient(-45deg, var(--plan) 0 2px, transparent 2px 7px); border-right: 2px dashed var(--plan); }
.tape-bar .seg-over { background: var(--bad); }
.tape-bar > div { height: 100%; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.tape-ticks { display: flex; justify-content: space-between; font-size: .7rem; color: var(--ink-3); margin-top: 4px; font-variant-numeric: tabular-nums; }
.tape-ticks span { position: relative; }
.tape-ticks span::before { content: ""; position: absolute; left: 50%; top: -5px; width: 1px; height: 4px; background: var(--ink-3); }
.tape-legend { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; margin-top: 16px; }
@media (min-width: 700px) { .tape-legend { grid-template-columns: repeat(4, 1fr); } }
.lg { display: flex; gap: 10px; align-items: flex-start; }
.lg i { width: 12px; height: 12px; border-radius: 3px; margin-top: 5px; flex: none; }
.lg b { display: block; font-family: var(--font-head); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.lg span { font-size: .8rem; color: var(--ink-3); }
.i-paid { background: var(--ink); } .i-unpaid { background: var(--warn); } .i-plan { background: var(--plan); } .i-free { background: var(--surface-2); border: 1px solid var(--ink-3); } .i-over { background: var(--bad); }
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.qa { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); cursor: pointer; font-size: .8rem; font-weight: 600; color: var(--ink-2); text-align: center; }
.qa svg { width: 24px; height: 24px; color: var(--steel); }
.qa:first-child { background: var(--hivis); border-color: var(--hivis); color: var(--hivis-ink); }
.qa:first-child svg { color: var(--hivis-ink); }
@media (min-width: 900px) { .quick-actions { display: none; } }

/* ---------- Liste ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; cursor: pointer; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface-2); }
.row .ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 1.15rem; flex: none; background: var(--surface-2); }
.row .body { flex: 1; min-width: 0; }
.row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { font-size: .82rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .right { text-align: right; flex: none; }
.row .amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.list-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 4px 14px; }
.day-head { font-size: .8rem; font-weight: 700; color: var(--ink-3); padding: 14px 4px 4px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: .74rem; font-weight: 700; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.paid { background: var(--ok-soft); color: var(--ok); }
.pill.partial { background: var(--warn-soft); color: var(--warn); }
.pill.unpaid { background: var(--bad-soft); color: var(--bad); }
.pill.plan { background: var(--steel-soft); color: var(--steel); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 4px; background: var(--steel-soft); color: var(--steel); font-size: .78rem; font-weight: 600; margin: 2px 4px 2px 0; text-decoration: none; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.toolbar .search { flex: 1 1 220px; position: relative; }
.toolbar .search input { padding-left: 38px; }
.toolbar .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters select, .filters input { min-height: 38px; padding: 6px 10px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface); font-size: .9rem; max-width: 100%; }
.sum-strip { display: flex; gap: 18px; flex-wrap: wrap; font-size: .88rem; color: var(--ink-2); margin: 0 4px 10px; }
.sum-strip b { color: var(--ink); font-variant-numeric: tabular-nums; }

.empty { text-align: center; padding: 36px 16px; color: var(--ink-3); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 12px; }

/* ---------- Kategorije graf ---------- */
.cat-bars { display: grid; gap: 10px; }
.cat-bar .lbl { display: flex; justify-content: space-between; font-size: .88rem; gap: 8px; }
.cat-bar .lbl span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-bar .trk { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; display: flex; margin-top: 4px; }
.cat-bar .trk i { display: block; height: 100%; }
.months { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 8px; }
.months .m { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.months .m i { width: 100%; max-width: 26px; background: var(--steel); border-radius: 3px 3px 0 0; min-height: 2px; }
.months .m span { font-size: .65rem; color: var(--ink-3); margin-top: 4px; }

/* ---------- Vremeplov ---------- */
.tl-month { margin-bottom: 22px; }
.tl-month h3 { position: sticky; top: 64px; background: var(--paper); padding: 6px 0; z-index: 2; display: flex; gap: 10px; align-items: baseline; }
.tl-month h3 small { font-family: var(--font-body); font-weight: 500; color: var(--ink-3); font-size: .85rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
@media (min-width: 700px) { .gallery { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
.ph { position: relative; aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); cursor: zoom-in; border: 0; padding: 0; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: .78rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox { position: fixed; inset: 0; background: rgba(8, 12, 14, .94); z-index: 100; display: flex; flex-direction: column; }
.lightbox .lb-img { flex: 1; display: grid; place-items: center; padding: 12px; min-height: 0; }
.lightbox img { max-height: 100%; max-width: 100%; object-fit: contain; }
.lightbox .lb-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); color: #E6ECEE; }
.lightbox .lb-bar .grow { flex: 1; min-width: 0; }
.lightbox .icon-btn { color: #fff; }
.lightbox .icon-btn:hover { background: rgba(255,255,255,.1); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 8px; } .lb-next { right: 8px; }

/* ---------- Sheet / modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 20, 22, .5); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.sheet { background: var(--surface); width: 100%; max-width: 620px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; border-radius: var(--radius-l) var(--radius-l) 0 0; padding: 8px 18px calc(20px + env(safe-area-inset-bottom)); animation: up .22s cubic-bezier(.2,.8,.2,1); }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; position: sticky; top: -8px; background: var(--surface); padding: 6px 0; z-index: 2; }
.sheet-foot { position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); background: var(--surface); padding: 12px 0 calc(20px + env(safe-area-inset-bottom)); margin-bottom: calc(-20px - env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; }
.sheet-foot .btn { flex: 1; }
@media (min-width: 700px) { .overlay { align-items: center; } .sheet { border-radius: var(--radius-l); max-height: 88vh; } .sheet-grip { display: none; } }
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.action-list { display: grid; gap: 8px; }
.action-list button { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-align: left; cursor: pointer; }
.action-list button:hover { border-color: var(--ink-3); }
.action-list button svg { width: 26px; height: 26px; color: var(--steel); flex: none; }
.action-list button b { display: block; }
.action-list button span { font-size: .84rem; color: var(--ink-3); }
.action-list button.primary { background: var(--hivis); border-color: var(--hivis); color: var(--hivis-ink); }
.action-list button.primary svg, .action-list button.primary span { color: var(--hivis-ink); }

.toast-wrap { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); z-index: 200; display: grid; gap: 8px; width: min(92vw, 420px); }
@media (min-width: 900px) { .toast-wrap { bottom: 24px; } }
.toast { background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: var(--radius); font-weight: 500; box-shadow: var(--shadow); animation: up .2s ease; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.toast.err { background: var(--bad); color: #fff; }
.toast button { background: none; border: 0; color: var(--hivis); font-weight: 700; cursor: pointer; }

/* ---------- Početna (landing + prijava) ---------- */
.land { background: var(--paper); min-height: 100vh; }
.land-hero { background: var(--side); color: #E6ECEE; padding: calc(16px + env(safe-area-inset-top)) 16px 40px; position: relative; overflow: hidden; }
.land-hero::after { content: ""; position: absolute; inset: auto -10% -1px -10%; height: 120px; background: radial-gradient(60% 100% at 50% 100%, rgba(218, 98, 67, .16), transparent 70%); pointer-events: none; }
.land-nav { display: flex; align-items: center; justify-content: space-between; max-width: 1160px; margin: 0 auto 28px; position: relative; z-index: 1; }
.land-nav .brand-logo { height: 32px; }
.land-link { color: #fff; text-decoration: none; font-weight: 600; padding: 8px 14px; border-radius: 99px; border: 1px solid rgba(255,255,255,.22); }
.land-link:hover { background: rgba(255,255,255,.08); }
.land-grid { max-width: 1160px; margin: 0 auto; display: grid; gap: 28px; position: relative; z-index: 1; }
.land-copy h1 { font-size: clamp(2.4rem, 1.5rem + 4.4vw, 4.6rem); color: #fff; line-height: .98; letter-spacing: -0.035em; }
.land-lead { color: #B9C4C8; font-size: clamp(11.5px, 3.45vw, 1.25rem); margin: 14px 0 0; white-space: nowrap; }
.land-card { background: var(--surface); color: var(--ink); border-radius: 20px; padding: 26px 22px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); align-self: start; }
.land-card h2 { font-size: 1.5rem; margin-bottom: 4px; }
.land-card .lead { color: var(--ink-3); margin-bottom: 18px; }
.demo { margin-top: 28px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 18px; padding: 18px; max-width: 520px; }
.demo-top { display: flex; justify-content: space-between; gap: 10px; }
.demo-lbl { font-size: .78rem; color: #93A1A7; font-weight: 600; }
.demo-big { font-family: var(--font-head); font-size: 2.2rem; font-weight: 800; color: #fff; letter-spacing: -0.02em; line-height: 1.1; }
.demo-big small { font-size: .5em; color: #93A1A7; }
.demo-sub { font-size: .85rem; color: #B9C4C8; }
.demo-left { text-align: right; }
.demo-ok { font-family: var(--font-head); font-size: 1.3rem; font-weight: 800; color: #7FD3A0; }
.demo-bar { margin-top: 14px; height: 22px; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); }
.demo-bar .seg-paid { background: #E6ECEE; }
.demo-legend { display: flex; gap: 14px; font-size: .75rem; color: #93A1A7; margin-top: 8px; }
.demo-legend span { display: inline-flex; align-items: center; gap: 5px; }
.demo-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.demo-legend .i-paid { background: #E6ECEE; }
.demo-rows { margin-top: 14px; display: grid; gap: 8px; }
.demo-row { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: #D5DDE0; }
.demo-row .dn { flex: 1; }
.demo-row b { color: #fff; font-variant-numeric: tabular-nums; }
.demo-row .cico { width: 32px; height: 32px; border-radius: 9px; background: color-mix(in srgb, var(--cc) 26%, var(--side)); color: color-mix(in srgb, var(--cc) 60%, white); }
.demo-row .cico svg { width: 18px; height: 18px; }
.land-wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.land-feats { padding: 44px 0 12px; }
.feat-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .feat-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .feat-grid { grid-template-columns: repeat(4, 1fr); } }
.feat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.feat .cico { --cc: var(--hivis) !important; margin-bottom: 12px; }
.feat h3 { margin-bottom: 6px; }
.feat p { color: var(--ink-2); font-size: .93rem; margin: 0; }
.land-steps { padding: 32px 0 40px; }
.land-steps h2 { font-size: 1.5rem; margin-bottom: 16px; }
.steps-list { list-style: none; counter-reset: st; padding: 0; margin: 0; display: grid; gap: 12px; }
@media (min-width: 800px) { .steps-list { grid-template-columns: repeat(3, 1fr); } }
.steps-list li { counter-increment: st; display: grid; align-content: start; grid-template-columns: 40px 1fr; gap: 2px 12px; align-items: start; }
.steps-list li::before { content: counter(st); grid-row: span 2; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; }
.steps-list b { font-weight: 700; }
.steps-list span { color: var(--ink-3); font-size: .92rem; }
.land-foot { border-top: 1px solid var(--line); padding: 20px 0 calc(24px + env(safe-area-inset-bottom)); }
.land-foot .land-wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--ink-3); font-size: .88rem; }
.land-foot .brand-logo { height: 24px; }
@media (min-width: 960px) {
  .land-hero { padding: 22px 32px 64px; }
  .land-grid { grid-template-columns: 1.15fr .85fr; grid-template-areas: "copy card" "demo card"; gap: 0 56px; align-items: center; }
  .land-copy { grid-area: copy; align-self: end; } .land-card { grid-area: card; align-self: center; } .demo { grid-area: demo; align-self: start; }
  .land-card { padding: 32px 30px; }
  .land-wrap { padding: 0 32px; }
}
@media (max-width: 959px) { .demo { margin-top: 0; } .land-grid { gap: 20px; } }
.auth-switch { margin-top: 16px; text-align: center; color: var(--ink-3); }

/* ---------- Wizard ---------- */
.wizard { max-width: 640px; margin: 0 auto; }
.steps { display: flex; gap: 6px; margin: 4px 0 22px; }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.steps i.on { background: var(--ink); }
.type-cards { display: grid; gap: 10px; }
.type-card { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; }
.pt-ico { width: 64px; height: 64px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.pt-ico svg { width: 50px; height: 50px; }
.pt-ico .r { fill: none; stroke: var(--hivis); stroke-width: 4.2; stroke-linecap: round; stroke-linejoin: round; }
.pt-ico .b { fill: var(--ink); }
.pt-ico .h { fill: var(--surface-2); }
.pt-ico .w { fill: none; stroke: var(--surface-2); stroke-width: 3.2; stroke-linecap: round; }
.pt-ico.pt-sm { width: 42px; height: 42px; border-radius: 11px; }
.pt-ico.pt-sm svg { width: 32px; height: 32px; }
.proj-card .pt-ico { width: 52px; height: 52px; border-radius: 14px; }
.proj-card .pt-ico svg { width: 40px; height: 40px; }
.proj-card.new svg { width: 28px; height: 28px; }
.type-card { padding: 14px 16px; }
.type-card:hover { border-color: var(--ink-3); }
.type-card b { display: block; font-size: 1.05rem; }
.type-card span { color: var(--ink-3); font-size: .9rem; }
.type-card.sel { border-color: var(--hivis); box-shadow: inset 0 0 0 1px var(--hivis); }
.prior-row { display: grid; grid-template-columns: 1fr 120px 40px; gap: 8px; margin-bottom: 8px; align-items: center; }
.prior-row .d { grid-column: 1 / 3; }
@media (min-width: 600px) { .prior-row { grid-template-columns: 1.4fr 130px 150px 40px; } .prior-row .d { grid-column: auto; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: .86rem; font-weight: 600; }
.chip:hover { border-color: var(--ink-3); }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- Projekti ---------- */
.proj-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.proj-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 18px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 10px; min-height: 160px; }
.proj-card:hover { border-color: var(--ink-3); }
.proj-card .t { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.proj-card h3 { font-size: 1.2rem; }
.proj-card .amt { font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; margin-top: auto; }
.proj-card.new { border-style: dashed; align-items: center; justify-content: center; color: var(--ink-2); font-weight: 600; }

/* ---------- Detalj ---------- */
.detail-amount { font-family: var(--font-head); font-size: 2.4rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: .94rem; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.file-tile { position: relative; aspect-ratio: 1; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; color: var(--ink-2); font-size: .75rem; padding: 6px; text-align: center; cursor: pointer; }
.file-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.file-tile .x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; z-index: 2; font-size: 14px; line-height: 1; }
.file-tile svg { width: 30px; height: 30px; margin-bottom: 4px; }
.file-tile .fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
.pick-files { border: 2px dashed var(--line); border-radius: var(--radius); padding: 14px; text-align: center; color: var(--ink-3); cursor: pointer; display: block; }
.pick-files:hover { border-color: var(--steel); color: var(--steel); }
.pick-files input { display: none; }
.pick-files svg { width: 28px; height: 28px; margin: 0 auto 4px; display: block; }
.pending-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pending-files .pf { display: flex; align-items: center; gap: 6px; background: var(--surface-2); border-radius: 6px; padding: 4px 8px; font-size: .8rem; max-width: 100%; }
.pending-files .pf img { width: 34px; height: 34px; object-fit: cover; border-radius: 4px; }
.pending-files .pf button { border: 0; background: none; cursor: pointer; color: var(--ink-3); }
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--steel); width: 0; transition: width .3s; }

/* ---------- AI ---------- */
.ask-box { background: var(--side); color: #E6ECEE; border-radius: var(--radius-l); padding: 20px; margin-bottom: 16px; }
.ask-box h2 { color: #fff; margin-bottom: 4px; }
.ask-box p { color: #AFBBBF; }
.ask-form { display: flex; gap: 8px; margin-top: 12px; }
.ask-form input { flex: 1; min-height: 50px; border-radius: var(--radius); border: 0; padding: 0 14px; background: #fff; color: #1E272B; min-width: 0; }
.ask-sugg { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.ask-sugg button { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #E6ECEE; border-radius: 99px; padding: 6px 12px; font-size: .84rem; cursor: pointer; }
.answer { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--hivis); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.answer .q { font-weight: 700; margin-bottom: 6px; }
.answer .a { white-space: pre-wrap; }
.answer .srcs { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.answer .srcs a { font-size: .82rem; padding: 4px 10px; border-radius: 6px; background: var(--steel-soft); color: var(--steel); text-decoration: none; font-weight: 600; }
.scan-preview { display: grid; gap: 14px; }
@media (min-width: 700px) { .scan-preview { grid-template-columns: 200px 1fr; } }
.scan-preview .orig { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); max-height: 320px; background: var(--surface-2); }
.scan-preview .orig img { width: 100%; object-fit: contain; max-height: 320px; }
.notice { padding: 10px 14px; border-radius: var(--radius-s); background: var(--warn-soft); color: var(--warn); font-size: .9rem; margin-bottom: 12px; }
.notice.info { background: var(--steel-soft); color: var(--steel); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--hivis); animation: spin .8s linear infinite; margin: 20px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-page { padding: 60px 0; }

/* bilješke */
.notes-grid { columns: 1; column-gap: 12px; }
@media (min-width: 700px) { .notes-grid { columns: 2; } }
@media (min-width: 1100px) { .notes-grid { columns: 3; } }
.note-card { break-inside: avoid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; cursor: pointer; }
.note-card.pinned { border-color: var(--hivis); box-shadow: inset 0 3px 0 var(--hivis); }
.note-card h3 { margin-bottom: 6px; }
.note-card .b { white-space: pre-wrap; color: var(--ink-2); font-size: .93rem; max-height: 220px; overflow: hidden; }
.note-card img { border-radius: 6px; margin-top: 8px; max-height: 160px; object-fit: cover; width: 100%; }

.more-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.more-grid a { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); font-weight: 600; }
.more-grid a svg { width: 26px; height: 26px; color: var(--steel); }
.more-grid a span { font-weight: 400; color: var(--ink-3); font-size: .82rem; }

.home-hero { background: linear-gradient(160deg, var(--steel), color-mix(in srgb, var(--steel) 60%, var(--side))); color: #fff; border-radius: var(--radius-l); padding: 22px; margin-bottom: 16px; }
.home-hero h1 { color: #fff; }
.home-hero p { color: rgba(255,255,255,.8); margin: 6px 0 0; }

/* ---------- Ikone kategorija ---------- */
.cico { --cc: var(--steel); width: 40px; height: 40px; border-radius: 11px; display: inline-grid; place-items: center; flex: none;
  color: var(--cc); background: color-mix(in srgb, var(--cc) 13%, var(--surface)); }
.cico svg { width: 21px; height: 21px; }
.cico.xs { width: 22px; height: 22px; border-radius: 6px; background: none; }
.cico.xs svg { width: 17px; height: 17px; }
.cat-lbl { display: inline-flex; align-items: center; gap: 4px; }
.ico-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.ico-pick button { border: 2px solid transparent; border-radius: 13px; background: none; padding: 1px; cursor: pointer; display: grid; place-items: center; }
.ico-pick button.on { border-color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cico { color: color-mix(in srgb, var(--cc) 70%, white); background: color-mix(in srgb, var(--cc) 22%, var(--surface)); } }
:root[data-theme="dark"] .cico { color: color-mix(in srgb, var(--cc) 70%, white); background: color-mix(in srgb, var(--cc) 22%, var(--surface)); }

/* ---------- Logo ---------- */
.brand-logo { height: 30px; width: auto; display: block; }
.side .brand .brand-logo { height: 32px; }
.auth-brand .brand-logo { height: 36px; }
.brand-logo.on-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-logo.on-light { display: none; } :root:not([data-theme="light"]) .brand-logo.on-dark { display: block; } }
:root[data-theme="dark"] .brand-logo.on-light { display: none; } :root[data-theme="dark"] .brand-logo.on-dark { display: block; }

/* ---------- Admin ---------- */
.admin { min-height: 100vh; background: var(--paper); }
.admin-wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.admin-top { background: var(--side); color: #fff; padding-top: env(safe-area-inset-top); }
.admin-top > div.admin-wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 10px; }
.admin-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.admin-badge { background: var(--hivis); color: #fff; font-weight: 700; font-size: .75rem; padding: 3px 9px; border-radius: 99px; }
.admin-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.admin-tabs a { color: #B9C4C8; text-decoration: none; font-weight: 600; padding: 12px 14px; border-bottom: 3px solid transparent; white-space: nowrap; }
.admin-tabs a.on { color: #fff; border-bottom-color: var(--hivis); }
.admin-wrap.admin-main { padding-top: 22px; padding-bottom: 60px; }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(5, 1fr); } .admin-wrap { padding: 0 32px; } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi span { font-size: .8rem; color: var(--ink-3); font-weight: 600; }
.kpi b { font-family: var(--font-head); font-size: 1.6rem; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi small { color: var(--ink-3); font-size: .8rem; }
.sys-row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.sys-row:last-child { border-bottom: 0; }
.sys-row .grow { flex: 1; font-weight: 500; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--steel-soft); color: var(--steel); display: grid; place-items: center; font-weight: 700; flex: none; }
.admin-save { position: sticky; bottom: 0; padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); display: flex; justify-content: flex-end; }
@media (max-width: 600px) { .hide-s { display: none; } }
.side .side-foot .side-admin { margin-left: auto; font-size: .78rem; padding: 2px 8px; border-radius: 99px; border: 1px solid rgba(255,255,255,.2); text-decoration: none; }
.row > svg { width: 18px; height: 18px; flex: none; color: var(--ink-3); }

/* SEO sadržaj prije učitavanja JS-a (isti tekst kao početna) */
.seo-pre { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Pravila */
.legal-body { background: var(--paper); }
.legal-top { background: var(--side); padding: calc(14px + env(safe-area-inset-top)) 0 14px; }
.legal-wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.legal-top .legal-wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.legal { padding-top: 28px; padding-bottom: 40px; }
.legal h1 { margin-bottom: 8px; }
.legal-meta { color: var(--ink-3); font-size: .92rem; }
.legal section { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-top: 18px; scroll-margin-top: 16px; }
.legal h2 { margin-bottom: 10px; }
.legal h3 { font-size: 1rem; margin: 18px 0 4px; }
.legal p, .legal li { color: var(--ink-2); line-height: 1.6; max-width: 75ch; }
.legal ul { padding-left: 20px; }
.legal-table { overflow-x: auto; margin: 10px 0; border: 1px solid var(--line); border-radius: 10px; }
.legal table { border-collapse: collapse; width: 100%; font-size: .88rem; min-width: 620px; }
.legal th, .legal td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
.legal th { background: var(--surface-2); color: var(--ink); font-weight: 700; }
.legal tr:last-child td { border-bottom: 0; }
.legal code { font-size: .85em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.land-foot a { color: inherit; }
.foot-links { display: flex; gap: 14px; flex-wrap: wrap; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--ink-2); margin: 4px 0 16px; cursor: pointer; }
.consent input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); flex: none; }
.legal-mini { font-size: .75rem; color: var(--side-ink); opacity: .7; padding: 10px 8px 0; }
.legal-mini a { color: inherit; }
