/* Računi zgrade — svetla tema.
   Ideja: miran, "malter" sivo-zelen ambijent, bela radna površina, duboka zelena kao znak "izmireno".
   Jedini glasan element je mapa zgrade: svaki stan je prozor obojen po stanju (plaćeno / dug / preplata). */
:root {
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --ink: #14201b;
  --ink-2: #34413b;
  --muted: #5f6a64;
  --line: #e4e9e6;
  --line-2: #cfd7d2;
  --brand: #0f6b57;
  --brand-2: #0b5546;
  --brand-ink: #ffffff;
  --brand-soft: #e3f1ec;
  --paid: #1d8a57;   --paid-soft: #e2f3e9;
  --debt: #d24a2e;   --debt-soft: #fce9e3;
  --part: #b7791f;   --part-soft: #fbf0dc;
  --credit: #2e66d9; --credit-soft: #e6edfc;
  --none: #a3aca7;   --none-soft: #eef1ef;
  --wa: #1f9d55; --vb: #6e4fd6;
  --paper: #ffffff; --paper-ink: #14201b; --paper-muted: #66706b; --paper-line: #d7ddd9; --paper-tint: #f1f6f3; --paper-accent: #0f6b57;
  --f-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r-lg: 18px; --r: 12px; --r-sm: 9px;
  --sh-1: 0 1px 2px rgba(20, 32, 27, .05), 0 1px 1px rgba(20, 32, 27, .03);
  --sh-2: 0 1px 2px rgba(20, 32, 27, .05), 0 10px 30px -14px rgba(20, 32, 27, .22);
  --sh-3: 0 24px 60px -20px rgba(20, 32, 27, .35);
  --topbar: 60px;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--ink); font-family: var(--f-sans); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body.locked { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.015em; text-wrap: balance; line-height: 1.2; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
a { color: var(--brand); }
a:hover { color: var(--brand-2); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.tiny { font-size: .76rem; }
.num { font-variant-numeric: tabular-nums; font-family: var(--f-mono); letter-spacing: -.01em; }
.mono { font-family: var(--f-mono); font-size: .92em; }
.strong { font-weight: 600; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
tr.click, button, .btn, a, .bcard, .cell { -webkit-tap-highlight-color: transparent; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }

/* ---------- Gornja traka ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.topbar .in { max-width: 1240px; margin: 0 auto; height: var(--topbar); display: flex; align-items: center; gap: 14px; padding-inline: max(20px, env(safe-area-inset-left, 0px)) max(20px, env(safe-area-inset-right, 0px)); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); border: 0; background: none; padding: 0; cursor: pointer; font: inherit; }
.brand .logo { width: 32px; height: 32px; }
.brand .wm { font-weight: 650; letter-spacing: -.01em; font-size: 1.02rem; white-space: nowrap; }
.crumb { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: .92rem; }
.crumb strong { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.sync { display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.sync::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--paid); box-shadow: 0 0 0 3px var(--paid-soft); }
.sync.busy::before { background: var(--part); box-shadow: 0 0 0 3px var(--part-soft); }
.sync.err { color: var(--debt); } .sync.err::before { background: var(--debt); box-shadow: 0 0 0 3px var(--debt-soft); }
.sync.local::before { background: var(--none); box-shadow: 0 0 0 3px var(--none-soft); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 650; font-size: .85rem; border: 0; cursor: pointer; }

/* ---------- Okvir stranice ---------- */
.page { max-width: 1240px; margin: 0 auto; padding-inline: max(20px, env(safe-area-inset-left, 0px)) max(20px, env(safe-area-inset-right, 0px)); padding-block: 26px calc(env(safe-area-inset-bottom, 0px) + 70px); }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.pagehead p { color: var(--muted); margin-top: 4px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.stack { display: grid; gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.span2 { grid-column: span 2; } .span3 { grid-column: 1 / -1; }
@media (max-width: 860px) { .grid3, .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .grid2, .grid3, .grid4 { grid-template-columns: minmax(0, 1fr); } .span2 { grid-column: auto; } }

/* ---------- Dugmad i polja ---------- */
button, .btn { font: inherit; font-size: .92rem; font-weight: 550; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); padding: 9px 14px; min-height: 40px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; justify-content: center; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; }
button:hover, .btn:hover { border-color: var(--muted); }
button.primary, .btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 6px 16px -8px rgba(15, 107, 87, .7); }
button.primary:hover, .btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
button.ink, .btn.ink { background: var(--ink); border-color: var(--ink); color: #fff; }
button.ghost, .btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
button.ghost:hover, .btn.ghost:hover { background: var(--surface-2); border-color: var(--line); }
button.danger { color: var(--debt); }
button.danger.solid { background: var(--debt); border-color: var(--debt); color: #fff; }
button.small, .btn.small { min-height: 32px; padding: 5px 10px; font-size: .84rem; border-radius: 8px; }
button:disabled { opacity: .45; cursor: not-allowed; }
.btn.wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn.vb { background: var(--vb); border-color: var(--vb); color: #fff; }
label.f { display: grid; gap: 6px; align-content: start; font-size: .84rem; color: var(--ink-2); font-weight: 550; min-width: 0; }
input, select, textarea { font: inherit; font-size: .95rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 9px 11px; width: 100%; min-width: 0; min-height: 42px; }
textarea { min-height: 90px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
select { appearance: none; -webkit-appearance: none; -moz-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f6a64' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; cursor: pointer; }
select::-ms-expand { display: none; }
input.num { text-align: right; }
input[readonly] { background: var(--surface-2); }
.hint { font-size: .78rem; color: var(--muted); font-weight: 400; }
.hint.ok, .ok { color: var(--paid); } .hint.bad, .bad { color: var(--debt); }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: .9rem; color: var(--ink); font-weight: 450; }
.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); }
@media (pointer: coarse) { input, select, textarea { font-size: 16px; } }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; min-height: 32px; padding: 5px 12px; color: var(--muted); font-size: .86rem; border-radius: 7px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.search { position: relative; flex: 1 1 240px; max-width: 360px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 36px; }

/* ---------- Paneli ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--sh-1); }
.panel > h3 + p { margin-top: 4px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel .phead { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.banner { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--brand-soft); color: var(--ink-2); border-radius: var(--r); padding: 11px 14px; font-size: .9rem; margin-bottom: 16px; }
.banner.warn { background: var(--part-soft); }
.inline-confirm { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--debt-soft); border-radius: var(--r); padding: 12px 14px; font-size: .9rem; }

/* ---------- Brojke ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); margin-bottom: 22px; }
.kpis > div { padding: 16px 20px; border-left: 1px solid var(--line); min-width: 0; }
.kpis > div:first-child { border-left: 0; }
.kpis .k { font-size: .82rem; color: var(--muted); }
.kpis .v { font-size: 1.45rem; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpis .v small { font-size: .78rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpis .d { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.kpis .v.debt { color: var(--debt); } .kpis .v.paid { color: var(--paid); }
@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpis > div:nth-child(3) { border-left: 0; } .kpis > div:nth-child(n+3) { border-top: 1px solid var(--line); } }
@media (max-width: 400px) { .kpis .v { font-size: 1.15rem; } .kpis > div { padding: 13px 14px; } }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; border-radius: 999px; padding: 3px 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.paid { color: var(--paid); background: var(--paid-soft); }
.chip.debt { color: var(--debt); background: var(--debt-soft); }
.chip.part, .chip.due { color: var(--part); background: var(--part-soft); }
.chip.credit { color: var(--credit); background: var(--credit-soft); }
.chip.none { color: var(--muted); background: var(--none-soft); }
.chip.plain::before { display: none; }
.tag { display: inline-block; font-size: .7rem; color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 0 5px; margin-left: 6px; vertical-align: 1px; font-weight: 500; }

/* ---------- Kartice zgrada (početni ekran) ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.bcard { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; align-items: start; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--sh-1); cursor: pointer; font: inherit; color: inherit; min-height: 0; white-space: normal; transition: box-shadow .15s, border-color .15s, transform .15s; }
.bcard:hover { border-color: var(--line-2); box-shadow: var(--sh-2); transform: translateY(-1px); }
.bcard .fac { width: 64px; height: 76px; }
.bcard .addr { font-weight: 650; font-size: 1.05rem; letter-spacing: -.01em; }
.bcard .city { color: var(--muted); font-size: .86rem; margin-top: 1px; }
.bcard .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.bcard .bar { height: 6px; border-radius: 6px; background: var(--none-soft); overflow: hidden; display: flex; margin-top: 12px; }
.bcard .bar span { display: block; height: 100%; }
.bcard .foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: .8rem; color: var(--muted); }
.bcard.add { border: 1.5px dashed var(--line-2); background: transparent; box-shadow: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--ink-2); min-height: 168px; }
.bcard.add:hover { border-color: var(--brand); color: var(--brand); background: var(--surface); }
.bcard.add .plus { width: 44px; height: 44px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
@media (max-width: 520px) { .bgrid { grid-template-columns: minmax(0, 1fr); gap: 12px; } .bcard { padding: 15px; grid-template-columns: 52px minmax(0, 1fr); gap: 13px; } .bcard .fac { width: 52px; height: 62px; } }

/* ---------- Zaglavlje zgrade ---------- */
.bhead { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 18px; align-items: center; margin-bottom: 18px; }
.bhead .fac { width: 76px; height: 90px; }
.bhead h1 { font-size: 1.85rem; }
.bhead .sub { color: var(--muted); margin-top: 4px; font-size: .92rem; }
.bhead .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 760px) { .bhead { grid-template-columns: 56px minmax(0, 1fr); gap: 14px; } .bhead .fac { width: 56px; height: 66px; } .bhead h1 { font-size: 1.4rem; } .bhead .acts { grid-column: 1 / -1; justify-content: stretch; } .bhead .acts > * { flex: 1; } }

/* ---------- Kartice odeljaka zgrade ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; border-radius: 0; background: none; min-height: 44px; padding: 10px 14px; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; flex: none; }
.tabs button:hover { color: var(--ink); border-color: transparent; }
.tabs button[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); }
.tabs .tb { margin-left: 6px; font-size: .72rem; font-weight: 650; background: var(--part-soft); color: var(--part); border-radius: 999px; padding: 1px 7px; }
.tabs .tb.hot { background: var(--debt-soft); color: var(--debt); }
@media (max-width: 760px) { .tabs { margin-inline: -20px; padding-inline: 12px; position: sticky; top: calc(var(--topbar) + env(safe-area-inset-top, 0px)); background: var(--bg); z-index: 20; } .tabs button { padding: 10px 11px; } }

/* ---------- Period ---------- */
.period { display: inline-flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; box-shadow: var(--sh-1); }
.period button { border: 0; min-height: 36px; width: 36px; padding: 0; background: transparent; color: var(--ink-2); }
.period button:hover { background: var(--surface-2); }
.period .pv { padding: 0 10px; min-width: 150px; text-align: center; line-height: 1.15; }
.period .pv b { display: block; font-weight: 650; text-transform: capitalize; }
.period .pv span { font-size: .74rem; color: var(--muted); }

/* ---------- Liste ---------- */
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th { text-align: left; font-size: .78rem; color: var(--muted); font-weight: 550; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--surface-2); }
td.r, th.r { text-align: right; }
td.num, th.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
td .sub { display: block; font-size: .8rem; color: var(--muted); margin-top: 1px; }
tr.group td { background: var(--surface-2); font-size: .8rem; font-weight: 600; color: var(--ink-2); padding-block: 8px; }
.ubadge { display: inline-grid; place-items: center; min-width: 46px; height: 34px; padding: 0 8px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 650; font-variant-numeric: tabular-nums; font-size: .92rem; }
.ucell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ucell .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icons { display: inline-flex; gap: 6px; color: var(--muted); vertical-align: -3px; margin-left: 6px; }
@media (max-width: 760px) { .hide-sm { display: none; } td, th { padding: 10px 10px; } .ubadge { min-width: 42px; height: 32px; font-size: .86rem; } }
.show-sm { display: none; } @media (max-width: 760px) { .show-sm { display: flex; } }

/* ---------- Mapa zgrade ---------- */
.map { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 18px; }
.map .roof { height: 10px; margin: 0 6px 10px; border-radius: 10px 10px 2px 2px; background: linear-gradient(var(--line-2), var(--line)); }
.floor { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; align-items: center; padding: 6px 0; border-top: 1px dashed var(--line); }
.floor:first-of-type { border-top: 0; }
.floor .fl { font-size: .8rem; color: var(--muted); font-weight: 550; }
.cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.cell { border: 1px solid transparent; border-radius: 10px; padding: 7px 8px 8px; text-align: left; min-height: 0; display: block; font: inherit; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.cell:hover { transform: translateY(-1px); box-shadow: var(--sh-2); }
.cell .cn { font-weight: 650; font-size: .92rem; font-variant-numeric: tabular-nums; }
.cell .ca { font-size: .74rem; font-variant-numeric: tabular-nums; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell.paid { background: var(--paid-soft); color: var(--paid); border-color: rgba(29, 138, 87, .18); }
.cell.debt { background: var(--debt-soft); color: var(--debt); border-color: rgba(210, 74, 46, .2); }
.cell.credit { background: var(--credit-soft); color: var(--credit); border-color: rgba(46, 102, 217, .18); }
.cell.due { background: var(--part-soft); color: var(--part); border-color: rgba(183, 121, 31, .2); }
.cell.none { background: var(--none-soft); color: var(--muted); }
.cell .cn { color: var(--ink); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-top: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
@media (max-width: 520px) { .floor { grid-template-columns: minmax(0, 1fr); gap: 6px; } .cells { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; } .map { padding: 12px; } }

/* ---------- Grafikon ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--f-sans); }
.chart .gl { stroke: var(--line); }
.chart .bz { fill: var(--line-2); }
.chart .bn { fill: var(--brand); }
.chart .lb { fill: var(--ink-2); font-weight: 600; }
.chart .rl { fill: none; stroke: var(--part); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .rd { fill: var(--part); stroke: var(--surface); stroke-width: 1.5; }
.chart .rax { fill: var(--part); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover { fill: var(--brand); opacity: .06; }
.rate { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; }
.ring { width: 92px; height: 92px; }
.ring .bg { stroke: var(--none-soft); } .ring .fg { stroke: var(--brand); }
.ring text { font-size: 19px; font-weight: 650; fill: var(--ink); font-family: var(--f-sans); }

/* ---------- Fioka ---------- */
.scrim { position: fixed; inset: 0; background: rgba(20, 32, 27, .38); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(780px, 100%); background: var(--bg); z-index: 41; overflow-y: auto; box-shadow: var(--sh-3); padding: calc(env(safe-area-inset-top, 0px) + 18px) 22px calc(env(safe-area-inset-bottom, 0px) + 30px); }
@media (prefers-reduced-motion: no-preference) { .drawer.enter { animation: slidein .22s cubic-bezier(.2, .8, .2, 1); } @keyframes slidein { from { transform: translateX(32px); } } }
@media (max-width: 760px) { .drawer { width: 100%; padding-inline: 16px; } }
.dh { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.dh .t { display: flex; gap: 12px; align-items: center; min-width: 0; }
.dh h2 { font-size: 1.35rem; }
.dh .s { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.balance { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; box-shadow: var(--sh-1); margin-bottom: 14px; }
.balance .big { font-size: 1.7rem; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.balance .big.debt { color: var(--debt); } .balance .big.paid { color: var(--paid); } .balance .big.credit { color: var(--credit); } .balance .big.due { color: var(--part); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 16px; }
.sendbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0 16px; }
.sendbar .btn, .sendbar button { flex-direction: column; gap: 4px; min-height: 64px; font-size: .8rem; }
@media (max-width: 520px) { .sendbar { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
details.box { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 12px 16px; margin-top: 12px; }
details.box summary { cursor: pointer; font-weight: 600; }
details.box[open] summary { margin-bottom: 10px; }
.msg { font-family: var(--f-sans); font-size: .9rem; white-space: pre-wrap; }
.ipsline { font-family: var(--f-mono); font-size: .76rem; word-break: break-all; background: var(--surface-2); padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); }
.timeline td { padding-block: 10px; }
.timeline .ti { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; }
.timeline .ti.r { background: var(--none-soft); color: var(--ink-2); }
.timeline .ti.u { background: var(--paid-soft); color: var(--paid); }

/* ---------- Račun (papir) ---------- */
.paper { background: var(--paper); color: var(--paper-ink); border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--sh-2); padding: 24px 26px; font-size: 12.5px; line-height: 1.42; }
@media (max-width: 520px) { .paper { padding: 16px 14px; font-size: 12px; } }
.paper .ph { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.paper .pn { font-weight: 650; font-size: 15px; }
.paper .pm { color: var(--paper-muted); }
.paper .pt { color: var(--paper-accent); font-weight: 650; font-size: 15px; text-align: right; }
.paper .meta { display: grid; grid-template-columns: auto auto; gap: 1px 14px; justify-content: end; margin-top: 4px; }
.paper .meta span:nth-child(odd) { color: var(--paper-muted); text-align: right; }
.paper .meta span:nth-child(even) { text-align: right; font-variant-numeric: tabular-nums; }
.paper hr { border: 0; border-top: 1px solid var(--paper-line); margin: 12px 0; }
.paper .lbl { font-size: 10px; color: var(--paper-muted); font-weight: 550; }
.paper .payer { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: stretch; }
.paper .due { background: var(--paper-tint); border-radius: 10px; padding: 9px 13px; min-width: 210px; }
.paper .due .amt { font-size: 21px; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.paper table { font-size: 12px; margin-top: 12px; }
.paper th { background: transparent; color: var(--paper-muted); border-color: var(--paper-line); padding: 6px 6px; font-size: 10px; }
.paper td { border-color: var(--paper-line); padding: 5px 6px; }
.paper .tot td { border: 0; padding: 3px 6px; color: var(--paper-muted); }
.paper .tot.b td { color: var(--paper-ink); font-weight: 650; }
.paper .strip { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; background: var(--paper-tint); border-radius: 10px; padding: 12px 14px; margin-top: 14px; }
.paper .fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; min-width: 0; }
.paper .fields > div { min-width: 0; }
.paper .fields .w { grid-column: 1 / -1; }
.paper .fields .v { font-family: var(--f-mono); font-size: 12px; overflow-wrap: anywhere; }
.paper .qrbox { text-align: center; }
.paper .qrbox .lbl { color: var(--paper-ink); font-weight: 650; letter-spacing: .08em; }
.paper .qrbox svg { display: block; background: #fff; max-width: none; }
.qrzoom { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; padding: 0; min-height: 0; margin-top: 6px; color: var(--paper-muted); font-size: 10.5px; font-weight: 550; cursor: zoom-in; white-space: nowrap; }
.qrzoom:hover { border: 0; color: var(--paper-accent); }
.qrzoom span { text-decoration: underline; text-underline-offset: 2px; }
.qrmiss { width: 176px; min-height: 176px; margin-top: 6px; display: grid; place-content: center; gap: 6px; text-align: center; padding: 14px; border: 1.5px dashed var(--line-2); border-radius: 8px; background: #fff; color: var(--paper-muted); font-size: 11px; line-height: 1.35; white-space: normal; }
.qrmiss b { color: var(--paper-ink); font-size: 12px; }
.qrfull { position: fixed; inset: 0; z-index: 80; background: #fff; display: grid; place-items: center; padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px calc(env(safe-area-inset-bottom, 0px) + 16px); overflow: auto; }
.qrfull-in { display: grid; gap: 12px; justify-items: center; text-align: center; max-width: 560px; }
.qrfull .qra { font-size: 1.6rem; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.qrfull svg { display: block; }
.paper .demo { color: var(--debt); font-weight: 650; font-size: 10px; letter-spacing: .08em; margin-bottom: 6px; }
@media (max-width: 560px) { .paper .strip { grid-template-columns: minmax(0, 1fr); } .paper .qrbox { justify-self: center; } .paper .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Podešavanja / forme ---------- */
.items { display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.5fr) auto; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.item.item4 { grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, 1fr) auto; }
@media (max-width: 760px) { .item, .item.item4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .item .wide { grid-column: 1 / -1; } }
.types { display: flex; gap: 12px; flex-wrap: wrap; padding-bottom: 10px; }
.savebar { position: sticky; bottom: 0; z-index: 5; padding-block: 12px calc(env(safe-area-inset-bottom, 0px) + 12px); background: linear-gradient(transparent, var(--bg) 30%); }
@media (max-width: 1023px) { .savebar { bottom: calc(58px + env(safe-area-inset-bottom, 0px)); } }

/* ---------- Prijava ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 50% -10%, var(--brand-soft), transparent 60%), var(--bg); }
.login-card { width: min(410px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 28px; box-shadow: var(--sh-3); }
.login-card .logo { width: 52px; height: 52px; }
.login-card h1 { font-size: 1.55rem; margin-top: 18px; }
.loading { padding: 90px 0; text-align: center; color: var(--muted); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: .9rem; z-index: 60; box-shadow: var(--sh-3); max-width: calc(100% - 32px); display: flex; gap: 12px; align-items: center; }
.toast button { background: #fff; color: var(--ink); border-color: transparent; }
@media (max-width: 760px) { .toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 72px); } }

/* pomoćni redovi koji se vide samo na telefonu (posle "td .sub") */
@media (min-width: 761px) { td .show-sm, .paper .show-sm { display: none; } }
@media (max-width: 760px) {
  .ucell > div { min-width: 0; max-width: calc(100vw - 236px); }
  table.units .ucell > div { max-width: calc(100vw - 120px); }
  .ucell .nm, .ucell .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.only-sm { display: none; }
@media (max-width: 760px) { .only-sm { display: table-cell; } td .hide-sm, td.hide-sm, th.hide-sm { display: none; } }
.repgrid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; margin-bottom: 16px; }
@media (max-width: 860px) { .repgrid { grid-template-columns: minmax(0, 1fr); } }

/* =====================================================================
   Okvir aplikacije: tamnozelena bočna traka (kompjuter), donja navigacija (telefon)
   ===================================================================== */
:root { --side-bg: #0c2620; --side-bg-2: #12332b; --side-ink: #d8e8e1; --side-muted: #8aa89c; --mint: #3ccf8e; --side-w: 252px; }
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.main { min-width: 0; }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 6px; padding: 18px 14px 16px; background: var(--side-bg); color: var(--side-ink); background-image: radial-gradient(420px 260px at -10% -10%, rgba(60, 207, 142, .16), transparent 70%); }
.sbrand { display: flex; gap: 12px; align-items: center; background: none; border: 0; color: #fff; padding: 6px 8px 18px; min-height: 0; justify-content: flex-start; text-align: left; white-space: normal; }
.sbrand:hover { border: 0; }
.sbrand .logo { width: 38px; height: 38px; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, .14); border-radius: 11px; }
.sbrand b { display: block; font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em; color: #fff; }
.sbrand small { display: block; color: var(--side-muted); font-family: var(--f-mono); font-size: .62rem; font-weight: 500; text-transform: uppercase; letter-spacing: .16em; margin-top: 2px; }
.snav { display: grid; gap: 2px; }
.snav button { justify-content: flex-start; gap: 12px; width: 100%; background: none; border: 0; color: var(--side-ink); padding: 10px 12px; min-height: 42px; border-radius: 10px; font-weight: 520; position: relative; }
.snav button:hover { background: rgba(255, 255, 255, .06); border: 0; }
.snav button[aria-current="page"] { background: rgba(60, 207, 142, .13); color: #fff; }
.snav button[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--mint); }
.snav button svg.i { opacity: .9; }
.navlbl { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--side-muted); padding: 14px 12px 6px; font-weight: 600; }
.newbld { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 4px 0 10px; padding: 11px; border-radius: 11px; background: var(--mint); color: #06231b; font-weight: 600; font-size: .9rem; border: 0; min-height: 44px; }
.newbld:hover { background: #4fd99a; border: 0; }
.nb { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; font-size: .72rem; font-weight: 700; background: rgba(255, 255, 255, .14); color: #fff; font-variant-numeric: tabular-nums; }
.nb.hot { background: #ff6b4a; color: #fff; }
.sfoot { margin-top: auto; display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sfoot .sync { color: var(--side-muted); }
.suser { justify-content: flex-start; gap: 10px; background: none; border: 0; color: var(--side-ink); padding: 6px; min-height: 0; text-align: left; white-space: normal; }
.suser:hover { border: 0; background: rgba(255, 255, 255, .05); }
.suser .avatar { background: rgba(60, 207, 142, .18); color: var(--mint); flex: none; }
.su { min-width: 0; }
.su b { display: block; font-size: .82rem; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.su small { color: var(--side-muted); font-size: .76rem; }
.topbar .in { max-width: 1240px; }
.topbar .crumb strong { font-size: 1rem; }
.tb-act { gap: 6px; }
.show-sm-i { display: none; }
.mob { display: none !important; }
.brand.mob .logo { width: 32px; height: 32px; }
.bottomnav { display: none; }
@media (min-width: 1024px) {
  .topbar { background: rgba(243, 245, 244, .82); border-bottom-color: transparent; }
  .page { padding-top: 10px; }
}
@media (max-width: 1023px) {
  .shell { display: block; }
  .side { display: none; }
  .mob { display: inline-flex !important; }
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: rgba(255, 255, 255, .95); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .bottomnav button { border: 0; border-radius: 0; background: none; flex-direction: column; gap: 3px; min-height: 58px; font-size: .7rem; font-weight: 560; color: var(--muted); padding: 6px 2px; }
  .bottomnav button[aria-current="page"] { color: var(--brand); }
  .bottomnav .bi { position: relative; display: inline-flex; }
  .bottomnav .nb { position: absolute; top: -6px; right: -12px; height: 17px; min-width: 17px; padding: 0 5px; font-size: .64rem; background: var(--brand); }
  .bottomnav .nb.hot { background: #ff5a36; }
  .page { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); }
}
@media (max-width: 760px) { .show-sm-i { display: inline; } .tb-act { padding-inline: 10px; } }

/* ---------- Statistika (Pregled) ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(196px, 100%), 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 15px 16px; box-shadow: var(--sh-1); min-height: 0; white-space: normal; font-weight: 400; }
.stat:hover { box-shadow: var(--sh-2); border-color: var(--line-2); }
.stat .si { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.stat .sv { font-size: 1.55rem; font-weight: 600; letter-spacing: -.02em; font-family: var(--f-mono); color: var(--ink); line-height: 1.1; }
.stat .sv small { font-size: .8rem; font-weight: 500; color: var(--muted); font-family: var(--f-sans); margin-left: 2px; }
.stat .sk { font-size: .8rem; color: var(--muted); font-weight: 500; }
.stat .sv + .sk { margin-top: -6px; }
.stat .sd { font-size: .76rem; color: var(--muted); }
.stat.hot .si { background: var(--debt-soft); color: var(--debt); }
.stat.hot .sv { color: var(--debt); }
.stat.warn .si { background: var(--part-soft); color: var(--part); }
.stat.good .si { background: var(--paid-soft); color: var(--paid); }
.stat.good .sv { color: var(--paid); }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .stat { padding: 13px 13px; gap: 7px; } .stat .sv { font-size: 1.3rem; } .stat .si { width: 28px; height: 28px; } }
.cols { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.feed { display: grid; }
.frow { display: flex; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); cursor: pointer; min-width: 0; }
.frow:last-child { border-bottom: 0; }
.frow:hover { background: var(--surface-2); }
.fm { min-width: 0; flex: 1; display: grid; gap: 1px; }
.ft { font-weight: 600; font-size: .93rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow .when { font-size: .8rem; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.empty.small { padding: 22px 16px; font-size: .88rem; }
.ubadge.sm { min-width: 38px; height: 30px; font-size: .82rem; }

/* ---------- Kategorije (ikonice u boji) ---------- */
.kat { --k: var(--brand); width: 38px; height: 38px; flex: none; border-radius: 11px; display: inline-grid; place-items: center; color: var(--k); background: color-mix(in srgb, var(--k) 13%, white); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--k) 18%, transparent); }
.kat.sm { width: 32px; height: 32px; border-radius: 9px; }
.kat.sm svg.i { width: 16px; height: 16px; }
.kat.xs { width: 22px; height: 22px; border-radius: 6px; }
.kat.xs svg.i { width: 13px; height: 13px; }
.kat.lg { width: 48px; height: 48px; border-radius: 14px; }
.kat.lg svg.i { width: 24px; height: 24px; }
.fsel select { min-height: 40px; padding-block: 7px; width: auto; max-width: 220px; }

/* ---------- Prijave: tabla ---------- */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(270px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.kcol { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; scroll-snap-align: start; min-width: 0; }
.kcol header { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; }
.kcol header b { font-size: .92rem; }
.kcol .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--debt); }
.kcol.k-work .dot { background: var(--part); }
.kcol.k-done .dot { background: var(--paid); }
.kcol .cnt { margin-left: auto; font-size: .78rem; color: var(--muted); font-weight: 600; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; }
.kbody { display: grid; gap: 10px; }
.kempty { color: var(--muted); font-size: .85rem; text-align: center; padding: 18px 8px; }
.tcard { display: grid; gap: 8px; text-align: left; justify-content: stretch; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; min-height: 0; white-space: normal; font-weight: 400; box-shadow: var(--sh-1); }
.tcard:hover { border-color: var(--line-2); box-shadow: var(--sh-2); }
.tcard.hot { border-color: rgba(210, 74, 46, .45); box-shadow: 0 0 0 3px var(--debt-soft); }
.tc-top { display: flex; gap: 10px; align-items: center; min-width: 0; }
.tc-h { min-width: 0; flex: 1; display: grid; }
.tc-h b { font-size: .92rem; }
.tc-h span { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-opis { margin: 0; font-size: .88rem; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tc-foot { display: flex; gap: 10px; align-items: center; font-size: .76rem; color: var(--muted); }
.tc-foot > span { display: inline-flex; gap: 4px; align-items: center; }
.tc-foot .who { font-weight: 600; color: var(--ink-2); max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
@media (max-width: 760px) { .kanban { grid-template-columns: repeat(3, 86%); margin-inline: -20px; padding-inline: 20px; scroll-padding-inline: 20px; } }

/* ---------- Prijava: fioka ---------- */
.steps { list-style: none; margin: 0 0 16px; padding: 20px 8px 18px; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.steps li { display: grid; justify-items: center; text-align: center; gap: 9px; position: relative; color: var(--muted); font-size: .78rem; padding: 0 6px; }
.steps li b { color: var(--ink-2); font-size: .8rem; font-weight: 600; line-height: 1.25; }
.steps .sd2 { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .82rem; background: var(--none-soft); color: var(--muted); position: relative; z-index: 1; }
/* linija napretka između kružića */
.steps li::before { content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 2px; background: var(--line-2); z-index: 0; }
.steps li:first-child::before { display: none; }
.steps li.done::before, .steps li.cur::before { background: var(--paid); }
.steps li.done .sd2 { background: var(--paid); color: #fff; }
.steps li.cur .sd2 { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
.steps li.done b, .steps li.cur b { color: var(--ink); }
.kopis { font-size: 1rem; line-height: 1.5; white-space: pre-wrap; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { padding: 0; width: 96px; height: 96px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); min-height: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kmeta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kmeta > div { display: grid; gap: 1px; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.kmeta b { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; }
.hotb { background: var(--debt-soft); color: var(--debt); font-weight: 600; }
.hist { list-style: none; margin: 0; padding: 6px 0; }
.hist li { display: grid; grid-template-columns: 128px 1fr; gap: 10px; padding: 8px 18px; font-size: .86rem; border-bottom: 1px solid var(--line); }
.hist li:last-child { border-bottom: 0; }
.hist .hd { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .hist li { grid-template-columns: 1fr; gap: 0; } }
.katgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.katbtn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; border-radius: 12px; min-height: 0; white-space: normal; text-align: center; font-size: .82rem; font-weight: 550; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.katbtn[aria-pressed="true"], .katbtn:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); color: var(--ink); }
.katgrid.sm .katbtn { flex-direction: row; justify-content: flex-start; text-align: left; padding: 8px 10px; }
.katgrid.sm .katbtn input { width: 16px; height: 16px; min-height: 0; accent-color: var(--brand); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chipbtn { min-height: 34px; padding: 6px 12px; border-radius: 999px; font-size: .84rem; gap: 6px; }
.chipbtn[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Plan održavanja ---------- */
.pgroup { margin-bottom: 18px; }
.pgroup h3 { font-size: .9rem; margin: 0 0 8px 2px; display: flex; gap: 6px; align-items: center; }
.pgroup h3::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--paid); }
.pgroup.g-late h3::before { background: var(--debt); }
.pgroup.g-soon h3::before { background: var(--part); }
.plist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
.prow { display: flex; gap: 14px; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.prow:last-child { border-bottom: 0; }
.prow:hover { background: var(--surface-2); }
.prow .pm { flex: 1; min-width: 0; display: grid; gap: 2px; }
.prow .pt { font-weight: 600; font-size: .94rem; }
.prow .ps { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .pd { display: grid; text-align: right; font-variant-numeric: tabular-nums; }
.prow .pd b { font-size: .9rem; }
.prow .pd span { font-size: .78rem; color: var(--muted); }
.prow.s-kasni .pd span { color: var(--debt); font-weight: 600; }
.prow.s-uskoro .pd span { color: var(--part); font-weight: 600; }
@media (max-width: 560px) { .prow { flex-wrap: wrap; gap: 10px; } .prow .pm { flex-basis: calc(100% - 52px); } .prow .pd { text-align: left; margin-left: 48px; flex: 1; } }
.tpl { display: grid; gap: 8px; }
.tplrow { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.tplrow input { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); flex: none; }
.tplrow:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.tplrow.ex { opacity: .55; cursor: default; }

/* ---------- Obaveštenja ---------- */
.nlist { display: grid; gap: 12px; }
.ncard { display: flex; gap: 14px; align-items: flex-start; text-align: left; justify-content: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--sh-1); min-height: 0; white-space: normal; font-weight: 400; }
.ncard:hover { box-shadow: var(--sh-2); border-color: var(--line-2); }
.nm2 { min-width: 0; display: grid; gap: 3px; }
.nt { font-weight: 650; font-size: 1rem; }
.ns { font-size: .8rem; color: var(--muted); }
.ncard p { margin: 4px 0 0; color: var(--ink-2); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Izvođači ---------- */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.vcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 14px; display: grid; gap: 12px; }
.vhead { display: flex; gap: 12px; align-items: center; justify-content: flex-start; text-align: left; background: none; border: 0; padding: 0; min-height: 0; white-space: normal; }
.vhead:hover { border: 0; }
.avatar.lg { width: 44px; height: 44px; font-size: 1.05rem; border-radius: 13px; }
.vt { font-weight: 650; }
.vs { font-size: .82rem; color: var(--muted); font-weight: 400; }
.vkats { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: .8rem; color: var(--ink-2); }
.vkats span:not(.kat) { margin-right: 4px; }
.vfoot { display: flex; gap: 6px; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; }

/* ---------- Za stanare ---------- */
.pubqr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; }
.pubqr svg { display: block; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); }
@media (max-width: 560px) { .pubqr { grid-template-columns: 1fr; justify-items: center; } }
.urlbox { font-family: var(--f-mono); font-size: .78rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; }
.bstrip { display: flex; gap: 8px; flex-wrap: wrap; margin: -6px 0 14px; }
.bstrip button { min-height: 32px; padding: 5px 12px; font-size: .84rem; border-radius: 999px; gap: 6px; background: var(--surface); }
.mlist .mrow { display: flex; gap: 12px; align-items: center; justify-content: flex-start; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 14px 16px; background: none; min-height: 0; }
.mlist .mrow:last-child { border-bottom: 0; }
.mlist .mrow .fm b { font-size: .95rem; }
.qrfull.photo { gap: 14px; align-content: center; justify-items: center; background: rgba(12, 22, 18, .92); }
.qrfull.photo img { max-width: 100%; max-height: 80vh; border-radius: 12px; }

/* =====================================================================
   Moja zgrada — aplikacija za stanare (stanar.html)
   ===================================================================== */
.st-body { background: var(--bg); }
.st-head { position: sticky; top: 0; z-index: 30; background: var(--side-bg); color: #fff; padding-top: env(safe-area-inset-top, 0px); background-image: radial-gradient(360px 200px at 0% -40%, rgba(60, 207, 142, .25), transparent 70%); }
.st-in { max-width: 560px; margin: 0 auto; display: flex; gap: 12px; align-items: center; padding: 12px 16px; min-height: 60px; }
.st-in .logo { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .15); flex: none; }
.st-t { display: grid; min-width: 0; }
.st-t b { font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-t span { font-size: .8rem; color: var(--side-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-back { background: rgba(255, 255, 255, .1); border: 0; color: #fff; width: 38px; height: 38px; min-height: 0; padding: 0; border-radius: 10px; flex: none; }
.st-back:hover { border: 0; background: rgba(255, 255, 255, .16); }
.st-wrap { max-width: 560px; margin: 0 auto; padding: 18px 16px calc(env(safe-area-inset-bottom, 0px) + 96px); display: grid; gap: 14px; align-content: start; }
.st-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; justify-content: center; background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.st-nav button { flex: 1; max-width: 140px; border: 0; border-radius: 0; background: none; flex-direction: column; gap: 3px; min-height: 60px; font-size: .72rem; font-weight: 560; color: var(--muted); }
.st-nav button[aria-current="page"] { color: var(--brand); }
.st-h1 { font-size: 1.45rem; margin: 4px 0 0; }
.st-h2 { font-size: 1rem; margin: 10px 0 -4px; color: var(--ink-2); }
.st-hero { border-radius: 22px; padding: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-2); display: grid; gap: 8px; }
.st-hero.debt { background: linear-gradient(160deg, #fff 40%, var(--debt-soft)); }
.st-hero.due { background: linear-gradient(160deg, #fff 40%, var(--part-soft)); }
.st-hero.paid, .st-hero.credit { background: linear-gradient(160deg, #fff 40%, var(--paid-soft)); }
.st-hero.brand { background: var(--side-bg); color: #fff; border-color: transparent; background-image: radial-gradient(420px 220px at 100% 0%, rgba(60, 207, 142, .3), transparent 70%); }
.st-hero.brand .st-hint { color: var(--side-ink); }
.st-hk { font-size: .82rem; color: var(--muted); font-weight: 550; }
.st-hero.brand .st-hk { color: var(--mint); }
.st-hv { font-size: 2.3rem; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.st-hv small { font-size: 1rem; color: var(--muted); font-weight: 550; letter-spacing: 0; }
.st-hv.sm { font-size: 1.5rem; }
.st-hs { display: flex; gap: 8px; flex-wrap: wrap; }
.st-hint { margin: 0; color: var(--ink-2); font-size: .92rem; }
.st-qr { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 10px; text-align: left; justify-content: stretch; min-height: 0; white-space: normal; font-weight: 500; color: var(--ink-2); font-size: .86rem; margin-top: 6px; }
.st-qr svg { display: block; width: 132px; height: auto; }
.st-qr span { display: flex; gap: 6px; align-items: flex-start; }
.st-pay summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--brand); padding: 6px 0; }
.st-f { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.st-f span { color: var(--muted); }
.st-f b { font-family: var(--f-mono); font-size: .84rem; font-weight: 500; overflow-wrap: anywhere; }
.st-cta { display: flex; gap: 14px; align-items: center; justify-content: flex-start; text-align: left; width: 100%; padding: 16px 18px; border-radius: 18px; background: var(--brand); border-color: var(--brand); color: #fff; min-height: 0; white-space: normal; box-shadow: 0 10px 24px -14px rgba(15, 107, 87, .9); }
.st-cta:hover { background: var(--brand-2); border-color: var(--brand-2); }
.st-cta span { flex: 1; display: grid; gap: 2px; }
.st-cta b { font-size: 1.08rem; }
.st-cta small { color: rgba(255, 255, 255, .78); font-weight: 450; font-size: .84rem; }
.st-cta.sec { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--sh-1); }
.st-cta.sec small { color: var(--muted); }
.st-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; }
/* ---------- Stanar: kako prima račun ---------- */
.st-kanal { border-radius: 22px; padding: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); display: grid; gap: 12px; }
.st-kanal.need { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft), var(--sh-2); }
.st-kanal h2 { font-size: 1.08rem; margin: 0; }
.st-kanal .st-hint { margin: -4px 0 0; }
.st-kopts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.st-kopt { display: grid; justify-items: start; gap: 4px; text-align: left; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1.5px solid var(--line); color: var(--ink); min-height: 0; white-space: normal; }
.st-kopt b { font-size: .98rem; }
.st-kopt small { color: var(--muted); font-size: .78rem; font-weight: 450; line-height: 1.3; }
.st-kopt .i { color: var(--brand); }
.st-kopt.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.st-kopt:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.st-kerr { margin: 0; color: #8f2a14; background: var(--debt-soft); border-radius: 10px; padding: 9px 12px; font-size: .88rem; }
.st-kact { display: flex; gap: 10px; justify-content: flex-end; }
.st-kact .primary { min-width: 140px; }
@media (max-width: 360px) { .st-kopts { grid-template-columns: 1fr; } }

/* ---------- Upravnik: slanje po kanalima ---------- */
.kanalpick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.kanalpick button { flex-direction: column; gap: 2px; padding: 10px 6px; min-height: 0; font-size: .86rem; }
.kanalpick button[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-2); box-shadow: inset 0 0 0 1px var(--brand); }
.kgroups { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.kgroup { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 6px; background: var(--surface); }
.kgroup .kn { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.kgroup .kc { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.kgroup .ks { color: var(--muted); font-size: .8rem; }
.kgroup button { margin-top: 4px; }
.kqueue { display: grid; gap: 12px; }
.kqueue .kcard { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 4px; background: var(--surface-2); }
.kqueue .kcard b { font-size: 1.05rem; }
.kqueue .kbig { display: flex; gap: 10px; flex-wrap: wrap; }
.kqueue .kbig .btn, .kqueue .kbig button { flex: 1; min-width: 150px; justify-content: center; }
.klog { display: grid; gap: 0; }
.klog .kl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.klog .kl:last-child { border-bottom: 0; }
.klog .kl span { color: var(--muted); font-size: .8rem; }
@media (max-width: 560px) { .kanalpick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.st-q { display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; text-align: center; padding: 14px 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: .8rem; font-weight: 560; text-decoration: none; min-height: 0; white-space: normal; }
.st-q svg.i { color: var(--brand); }
.st-list { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.st-row { display: flex; gap: 12px; align-items: center; justify-content: flex-start; text-align: left; width: 100%; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--surface); color: var(--ink); text-decoration: none; min-height: 0; white-space: normal; font-weight: 500; }
.st-list > :last-child { border-bottom: 0; }
.st-row > span:not(.kat):not(.chip):not(.num) { flex: 1; display: grid; gap: 1px; min-width: 0; }
.st-row small { color: var(--muted); font-size: .8rem; font-weight: 450; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-row > svg.i:first-child { color: var(--brand); }
section.st-hero + .st-row { border: 1px solid var(--line); border-radius: 16px; }
.st-led { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.st-led .fm { flex: 1; min-width: 0; display: grid; }
.st-led .fm b { font-size: .9rem; font-weight: 560; }
.st-led .fm small { color: var(--muted); font-size: .78rem; }
.st-led .ti { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--none-soft); color: var(--ink-2); flex: none; }
.st-led .ti.u { background: var(--paid-soft); color: var(--paid); }
/* Tok i poruke na prijavi */
.st-timeline { display: grid; gap: 8px; }
.st-ev { display: flex; gap: 10px; align-items: flex-start; }
.st-ev .st-ev-i { width: 28px; height: 28px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--muted); display: grid; place-items: center; flex: 0 0 auto; margin-top: 1px; }
.st-ev.msg .st-ev-i { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.st-ev .st-ev-b { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.st-ev.msg .st-ev-b { background: var(--brand-soft); border-color: transparent; }
.st-ev .st-ev-who { display: block; font-size: .7rem; font-weight: 700; color: var(--brand); margin-bottom: 2px; }
.st-ev .st-ev-t { font-size: .9rem; color: var(--ink); white-space: pre-wrap; }
.st-ev .st-ev-d { display: block; font-size: .7rem; color: var(--muted); margin-top: 3px; }
.st-note { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.st-note.imp { border-color: rgba(210, 74, 46, .4); box-shadow: 0 0 0 3px var(--debt-soft); }
.st-nh { display: flex; gap: 10px; justify-content: space-between; align-items: baseline; }
.st-nh span { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.st-note p { margin: 6px 0 0; white-space: pre-wrap; color: var(--ink-2); font-size: .92rem; }
/* Glasanje (deli ga stanar i upravnik) */
.vote { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.vote-h { font-size: .78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 9px; }
.vopts { display: grid; gap: 8px; }
.vopt { width: 100%; justify-content: center; min-height: 46px; font-weight: 600; border-color: var(--line-2); }
.vopt:hover { border-color: var(--brand); color: var(--brand); }
.vbars { display: grid; gap: 10px; }
.vbar-row { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; align-items: baseline; }
.vbar-label { grid-column: 1; grid-row: 1; font-size: .9rem; color: var(--ink); }
.vbar-n { grid-column: 2; grid-row: 1; font-size: .78rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.vbar-track { grid-column: 1 / -1; grid-row: 2; height: 8px; border-radius: 6px; background: var(--none-soft); overflow: hidden; }
.vbar-fill { display: block; height: 100%; background: var(--brand); border-radius: 6px; min-width: 2px; transition: width .3s; }
.vbar-row.mine .vbar-label { font-weight: 700; color: var(--brand); }
.vbar-row.mine .vbar-fill { background: var(--paid); }
.vme { font-size: .72rem; font-weight: 700; color: var(--paid); margin-left: 6px; }
.vlog { margin-top: 10px; display: grid; gap: 4px; }
.vlog .vl { display: flex; justify-content: space-between; gap: 10px; font-size: .82rem; padding: 4px 0; border-top: 1px dashed var(--line); }
.vlog .vl b { font-weight: 560; }
.vlog .vl span { color: var(--muted); white-space: nowrap; }
.st-empty { text-align: center; color: var(--muted); padding: 22px 12px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: 16px; font-size: .9rem; }
.st-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.st-up { display: flex; gap: 12px; align-items: center; }
.st-up > div { display: grid; }
.st-kv { display: grid; gap: 10px; }
.st-kv > div { display: grid; gap: 1px; }
.st-kv span { font-size: .78rem; color: var(--muted); }
.st-items { width: 100%; }
.st-items td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.st-items td small { display: block; color: var(--muted); font-size: .76rem; }
.st-items .tot td { border: 0; color: var(--muted); padding: 4px 0; }
.st-items .tot.b td { color: var(--ink); font-weight: 700; font-size: 1.02rem; padding-top: 8px; }
.st-kats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.st-kat { display: flex; gap: 12px; align-items: center; justify-content: flex-start; text-align: left; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); min-height: 0; white-space: normal; font-weight: 600; font-size: .92rem; box-shadow: var(--sh-1); }
.st-kat:hover { border-color: var(--brand); }
.st-chosen { display: flex; gap: 12px; align-items: center; justify-content: flex-start; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; min-height: 0; white-space: normal; }
.st-chosen span { display: grid; }
.st-chosen small { color: var(--brand); font-weight: 550; }
.st-savet { margin: 0; }
.st-form { display: grid; gap: 14px; }

/* Stanar — redizajn (artboard Stanar/StanarKvar/StanarRacuni) */
.st-phero { background: var(--side-bg); color: #fff; margin: -18px -16px 2px; padding: 18px 20px 22px; border-radius: 0 0 20px 20px; background-image: radial-gradient(420px 220px at 100% 0%, rgba(60, 207, 142, .28), transparent 70%); display: grid; gap: 2px; }
.st-phero .pl { font-size: .8rem; color: var(--mint); font-weight: 550; }
.st-phero .pv { font-size: 2.4rem; font-weight: 700; letter-spacing: -.03em; font-family: var(--f-mono); line-height: 1.05; }
.st-phero .pv small { font-size: 1rem; color: #b9d6cb; font-weight: 600; font-family: var(--f-sans); margin-left: 3px; }
.st-split { display: flex; gap: 9px; margin-top: 12px; }
.st-split .s { flex: 1 1 0; background: rgba(255, 255, 255, .08); border-radius: 11px; padding: 10px 12px; }
.st-split .s .sl { font-size: .72rem; color: #8fb3a7; display: flex; align-items: center; gap: 6px; }
.st-split .s .sl .d { width: 7px; height: 7px; border-radius: 50%; }
.st-split .s .sv { font-size: .95rem; font-weight: 600; color: #fff; margin-top: 3px; font-family: var(--f-mono); }
.st-qrcard { padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.st-qrcard h2 { font-size: .9rem; font-weight: 600; }
.st-qrcard .qrbox { padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; min-height: 0; }
.st-qrcard .qrbox svg { display: block; width: 150px; height: auto; }
.st-qrcard .hint { font-size: .78rem; color: var(--muted); text-align: center; max-width: 250px; }
.st-steps { display: flex; gap: 6px; width: 100%; }
.st-steps .s3 { flex: 1 1 0; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px; text-align: center; }
.st-steps .s3 .n { width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: .72rem; font-weight: 700; display: grid; place-items: center; margin: 0 auto 6px; font-family: var(--f-mono); }
.st-steps .s3 span { font-size: .66rem; color: var(--muted); line-height: 1.3; display: block; }
.st-dcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); }
.st-drow { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); }
.st-drow:last-child { border-bottom: 0; }
.st-drow .dl { font-size: .72rem; color: var(--muted); min-width: 78px; flex: 0 0 auto; }
.st-drow .dv { font-size: .82rem; font-weight: 500; min-width: 0; word-break: break-word; font-family: var(--f-mono); }
.st-drow .dv.sans { font-family: var(--f-sans); }
.st-drow .cp { margin-left: auto; width: 32px; height: 32px; min-height: 0; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: grid; place-items: center; flex: 0 0 auto; padding: 0; }
.st-drow .cp:hover { color: var(--brand); background: var(--surface-2); }
.st-mini { display: flex; align-items: center; gap: 11px; padding: 13px 15px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); min-height: 0; white-space: normal; }
.st-mini .mi { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: 0 0 auto; }
.st-mini .mt { flex: 1; display: grid; min-width: 0; }
.st-mini .mt b { font-size: .82rem; font-weight: 600; }
.st-mini .mt span { font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-mini .ch { color: var(--muted); flex: 0 0 auto; }
.st-sect { font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 2px 2px 0; }
/* Stanar — Računi */
.st-sum { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); padding: 16px; display: flex; align-items: center; gap: 14px; }
.st-sum .k { font-size: .72rem; color: var(--muted); }
.st-sum .v { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; color: var(--debt); font-family: var(--f-mono); }
.st-sum .sp { margin-left: auto; display: flex; flex-direction: column; gap: 5px; text-align: right; }
.st-sum .sp .l { font-size: .68rem; color: var(--muted); }
.st-sum .sp .n { font-size: .78rem; font-weight: 600; font-family: var(--f-mono); }
.st-ch { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 12px 15px; border-bottom: 1px solid var(--line-2); }
.st-lrow { display: flex; align-items: center; gap: 11px; padding: 12px 15px; border: 0; border-bottom: 1px solid var(--line-2); width: 100%; text-align: left; background: var(--surface); min-height: 0; white-space: normal; }
.st-dcard > .st-lrow:last-child { border-bottom: 0; }
.st-lrow .ic { width: 32px; height: 32px; border-radius: 8px; background: var(--bg); display: grid; place-items: center; color: var(--muted); flex: 0 0 auto; }
.st-lrow .ic.ok { background: var(--paid-soft); color: var(--paid); }
.st-lrow .lt { flex: 1; min-width: 0; display: grid; gap: 1px; }
.st-lrow .lt b { font-size: .82rem; font-weight: 600; }
.st-lrow .lt > span { font-size: .72rem; color: var(--muted); }
.st-lrow .lt .open { color: var(--brand); font-weight: 600; display: inline-flex; align-items: center; gap: 2px; }
.st-lrow .lr { margin-left: auto; text-align: right; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; flex: 0 0 auto; }
.st-lrow .amt { font-size: .82rem; font-weight: 600; font-family: var(--f-mono); }
/* Stanar — Prijavi kvar */
.st-sect2 { font-size: .78rem; font-weight: 600; margin-bottom: 9px; }
.st-cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.st-cat { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 6px; background: var(--surface); font-size: .72rem; font-weight: 600; color: var(--ink); min-height: 0; white-space: normal; text-align: center; }
.st-cat svg.i { color: var(--muted); }
.st-cat.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.st-cat.on svg.i { color: var(--brand); }
.st-tip { display: flex; gap: 9px; align-items: flex-start; font-size: .78rem; color: var(--ink-2); background: var(--brand-soft); border-radius: 11px; padding: 11px 12px; }
.st-tip svg.i { flex: 0 0 auto; color: var(--brand); margin-top: 1px; }
.st-photo { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1.5px dashed var(--line-2); border-radius: 16px; background: var(--surface); cursor: pointer; color: var(--brand); }
.st-photo img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; }
.st-photo span { display: grid; color: var(--ink); }
.st-photo small { color: var(--muted); }
.st-toggle { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; }
.st-toggle input { width: 22px; height: 22px; min-height: 0; accent-color: var(--debt); margin-top: 2px; flex: none; }
.st-toggle span { display: grid; }
.st-toggle small { color: var(--muted); }
.st-toggle:has(input:checked) { border-color: var(--debt); background: var(--debt-soft); }
.st-send { min-height: 52px; font-size: 1.02rem; border-radius: 14px; }
.st-done { text-align: center; display: grid; gap: 12px; justify-items: center; padding: 30px 8px; }
.st-done p { margin: 0; color: var(--ink-2); }
.st-ok { width: 72px; height: 72px; border-radius: 50%; background: var(--paid-soft); color: var(--paid); display: grid; place-items: center; }
.st-ok svg.i { width: 36px; height: 36px; stroke-width: 2.4; }
.st-track { display: grid; justify-items: center; text-align: center; gap: 4px; }
.st-err { text-align: center; display: grid; gap: 12px; justify-items: center; padding: 50px 10px; }
.st-err .logo { width: 56px; height: 56px; }
@media (min-width: 700px) { .st-wrap { padding-top: 26px; } }

@media (min-width: 1024px) {
  .shell { background: linear-gradient(90deg, var(--side-bg) var(--side-w), var(--bg) var(--side-w)); }
  .topbar.tb-plain { display: none; }
  .page { padding-top: 30px; }
}

/* ---------- Slanje računa emailom ---------- */
.banner.bad { background: var(--debt-soft); color: #8f2a14; }
.mailform { margin-bottom: 4px; }
.mailform input[type=email] { font-size: 1rem; }
.mailmeta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 2px 0 0; font-size: .88rem; }
.mailmeta dt { color: var(--muted); }
.mailmeta dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.mailprev { display: block; width: 100%; height: 900px; border: 1px solid var(--line); border-radius: var(--r); background: #f1f4f3; }
.mailbulk { margin-bottom: 14px; }
.mbar { height: 8px; border-radius: 4px; background: var(--none-soft); overflow: hidden; }
.mbar span { display: block; height: 100%; background: var(--brand); border-radius: 4px; transition: width .3s ease; }
@media (prefers-reduced-motion: reduce) { .mbar span { transition: none; } }
@media (max-width: 560px) { .mailmeta { grid-template-columns: 1fr; gap: 2px; } .mailmeta dd { margin-bottom: 6px; } }

/* ---------- Čarobnjak „Nova zgrada" ---------- */
.wz-steps { display: flex; gap: 4px; list-style: none; padding: 0; margin: 0 0 20px; overflow-x: auto; scrollbar-width: none; }
.wz-steps::-webkit-scrollbar { display: none; }
.wz-steps li { flex: 1; min-width: 78px; }
.wz-steps button { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; border: 0; background: none; padding: 8px 4px; color: var(--muted); font-size: .78rem; font-weight: 550; border-top: 2px solid var(--line); }
.wz-steps .wz-n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); font-weight: 650; font-variant-numeric: tabular-nums; }
.wz-steps .wz-n .i { width: 16px; height: 16px; }
.wz-steps li.now button { color: var(--ink); border-top-color: var(--brand); }
.wz-steps li.now .wz-n { background: var(--brand); color: #fff; border-color: var(--brand); }
.wz-steps li.done button { color: var(--ink-2); border-top-color: var(--brand); }
.wz-steps li.done .wz-n { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-soft); }
.wz-card { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; }
.wz-card.sel { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: var(--brand-soft); }
.wz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 18px; }
.wz-sum { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
table input.cell { width: 100%; min-width: 56px; }
@media (max-width: 520px) { .wz-grid { grid-template-columns: minmax(0, 1fr); } .wz-steps .wz-l { display: none; } }

/* ===== Google prijava + „ili" linija ===== */
.gbtn { width: 100%; justify-content: center; gap: 10px; min-height: 44px; font-weight: 600; background: var(--surface); border: 1px solid var(--line-2); }
.gbtn:hover { background: var(--surface-2); }
.gbtn .gg { flex: 0 0 auto; }
.ordiv { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .82rem; }
.ordiv::before, .ordiv::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.linklike { display: inline; padding: 0; min-height: 0; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.linklike:hover { color: var(--brand-2); }

/* ===== Onboarding: dobrodošli (kartice) ===== */
.onb-welcome h3 { margin-bottom: 12px; }
.onb-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.onb-card { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); overflow: hidden; display: flex; flex-direction: column; }
.onb-shot { background: var(--surface-2); border-bottom: 1px solid var(--line); aspect-ratio: 16 / 10; overflow: hidden; }
.onb-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.onb-shot.noimg { display: none; }
.onb-cap { padding: 12px 14px; }
.onb-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: .82rem; margin-bottom: 6px; }
.onb-cap b { display: block; }

/* ===== Onboarding: progresivna čeklista ===== */
.onb { margin-bottom: 16px; padding: 0; overflow: hidden; }
.onb-list { display: flex; flex-direction: column; }
.onb-row { width: 100%; justify-content: flex-start; gap: 12px; text-align: left; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 14px 20px; min-height: 60px; background: var(--surface); }
.onb-row:hover:not([disabled]) { background: var(--surface-2); }
.onb-row .fm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.onb-row[disabled] { opacity: 1; cursor: default; color: var(--muted); }
.onb-ck { display: inline-grid; place-items: center; flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-2); color: var(--brand-ink); }
.onb-row.ok .onb-ck { background: var(--brand); border-color: var(--brand); }
.onb-row.ok b { text-decoration: line-through; }

/* ===== Uputstvo (strana sa slikama) ===== */
.upz { margin-bottom: 14px; }
.upz-h { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.upz-n { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 700; flex: 0 0 auto; }
.upz-shot { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 12px; max-width: 760px; }
.upz-shot img { width: 100%; display: block; }
.upz-shot.noimg { display: none; }
.upz-b { color: var(--ink-2); line-height: 1.6; }

@media (max-width: 720px) { .onb-cards { grid-template-columns: minmax(0, 1fr); } }
@media print { .side, .topbar, .mobnav, .pagehead button, .onb { display: none !important; } .main, .page { margin: 0 !important; padding: 0 !important; } }

/* ===== Platform konzol (admin platforme) ===== */
.kon { min-height: 100vh; background: var(--bg); }
.kon-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.kon-brand { display: flex; align-items: center; gap: 10px; }
.kon-brand b { display: block; line-height: 1.15; }
.kon-seg { margin-left: auto; }
.kon-top > .ghost { margin-left: 8px; }
.kon-page { padding: 24px 20px; max-width: 1100px; margin: 0 auto; }
.drillbar { display: flex; align-items: center; gap: 10px; background: var(--part-soft); color: var(--part); border-bottom: 1px solid var(--line); padding: 9px 20px; font-size: .9rem; font-weight: 600; }
.modchips { display: flex; flex-wrap: wrap; gap: 4px; }
.modchip { font-size: .72rem; font-weight: 600; padding: 2px 9px; min-height: 0; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--muted); }
.modchip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-2); }
@media (max-width: 620px) { .kon-seg { margin: 0; order: 3; width: 100%; } .kon-page { padding: 16px; } }

/* ===== Funkcionalnosti (prekidači modula) ===== */
.fnlist { display: flex; flex-direction: column; }
.fnrow { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--line); }
.fnrow:first-child { border-top: 0; }
.fnrow .fm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.toggle { position: relative; width: 46px; height: 28px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); padding: 0; flex: 0 0 auto; min-height: 0; cursor: pointer; transition: background .15s, border-color .15s; }
.toggle .knob { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform .15s; }
.toggle.on { background: var(--brand); border-color: var(--brand); }
.toggle.on .knob { transform: translateX(18px); }

/* ===== Brend: logo slika + polja za upload ===== */
.brandimg { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; background: #fff; }
.brandrow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brandprev { width: 64px; height: 64px; border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; overflow: hidden; background: var(--surface-2); flex: 0 0 auto; }
.brandprev img { width: 100%; height: 100%; object-fit: contain; }

/* ===== Brend ZgradaOS (js/brend.js) ===== */
.brandlock { margin: 0; line-height: 0; }
.brandlock svg { height: 44px; width: auto; max-width: 100%; }
.sfoot .pokrece { justify-self: start; height: 12px; width: auto; margin-left: 6px; opacity: .85; }
.kon-brand svg.logo { width: 36px; height: 36px; flex: none; border-radius: 10px; }
.st-by { display: flex; justify-content: center; margin: 22px 0 6px; }
.st-by svg { height: 12px; width: auto; }
