/* =========================================================================
   styles.css — Vizuelni sistem „Moj Grad Budva" (SPEC sekcija 7)
   Institucionalna jadranska plava. Bez web-fontova/CDN-a — sistemski stack.
   ========================================================================= */

:root {
  --brand: #0E6BA8;
  --brand-dark: #0A527F;
  --accent: #1AA7A0;
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --text: #1B2733;
  --text-muted: #5B6B7B;
  --border: #E1E7EE;
  --ok: #1E8E5A;
  --warn: #E08A1E;
  --danger: #D14343;
  --info: #0E6BA8;
  --brand-soft: #E8F1F8;     /* svijetloplava (predpopunjeno polje, aktivna stavka) */
  --shadow-card: 0 1px 3px rgba(0,0,0,.08);
  --shadow-modal: 0 12px 40px rgba(0,0,0,.22);
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-w: 232px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
h1, h2, h3 { margin: 0 0 .5em; font-weight: 700; line-height: 1.3; }
p { margin: 0 0 1em; }
a { color: var(--brand); }
small, .sitno { font-size: 13px; }

button { font-family: inherit; }

/* ===================== DUGMAD ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
  background: var(--surface);
  color: var(--text);
}
.btn:focus-visible { outline: 3px solid rgba(14,107,168,.35); outline-offset: 2px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-secondary { background: var(--surface); color: var(--brand); border-color: var(--brand); }
.btn-secondary:hover:not(:disabled) { background: var(--brand-soft); }
.btn-ghost { background: transparent; color: var(--brand); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--brand-soft); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }

/* ===================== KARTICA ===================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
}

/* ===================== ČIP / TAG / BEDŽ ===================== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.dot-info { background: var(--info); }
.dot-ok { background: var(--ok); }
.dot-warn { background: var(--warn); }

.tag-status {
  font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px;
  display: inline-flex; align-items: center; gap: 5px;
}
.tag-ok { background: #E6F4EC; color: var(--ok); }
.tag-warn { background: #FBF0DF; color: #9a5e07; }
.tag-info { background: #E8F1F8; color: var(--brand); }
.tag-danger { background: #FBE6E6; color: var(--danger); }

.badge-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--info); color: #fff;
}
.badge-dot {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--warn); color: #fff;
}

/* ===================== IKONE ===================== */
.icon { width: 20px; height: 20px; flex: 0 0 auto; display: inline-block; vertical-align: middle; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 26px; height: 26px; }

/* ===================== LJUSKA: TOP BAR + SIDEBAR ===================== */
.app-shell { min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: var(--brand);
  color: #fff;
}
.topbar .logo { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .3px; }
.topbar .logo .grb { width: 30px; height: 30px; object-fit: contain; }
.topbar .logo .wordmark { font-size: 16px; }
.topbar .spacer { flex: 1; }
.topbar .user { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.topbar .topbtn {
  background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius); min-height: 36px; padding: 0 10px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.topbar .topbtn:hover { background: rgba(255,255,255,.26); }
.hamburger { display: none; }

/* Jezički prekidač (segmentirani) */
.lang-switch { display: inline-flex; border: 1px solid rgba(255,255,255,.4); border-radius: 999px; overflow: hidden; }
.lang-switch button {
  background: transparent; color: #fff; border: none; cursor: pointer;
  padding: 5px 10px; font-size: 12px; font-weight: 700;
}
.lang-switch button.active { background: #fff; color: var(--brand); }

.body-row { display: flex; align-items: stretch; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  /* donji prostor da plutajuće dugme „Pomoć" (dole-lijevo) ne prekrije „Resetuj demo" */
  padding: 14px 10px 70px;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  border: none; background: transparent; width: 100%; text-align: left;
  position: relative;
  font-size: 14px;
}
.nav-item:hover { background: var(--bg); }
.nav-item .icon { color: var(--text-muted); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-dark); }
.nav-item.active .icon { color: var(--brand); }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  background: var(--brand); border-radius: 0 3px 3px 0;
}
.nav-item .nav-label { flex: 1; }
.nav-sep { height: 1px; background: var(--border); margin: 8px 6px; }
.nav-spacer { flex: 1; }
.nav-reset { color: var(--text-muted); }
.nav-reset .icon { color: var(--text-muted); }

.main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 24px 28px 48px;
}
.page { max-width: 920px; }
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.page-head .icon { color: var(--brand); }
.page-head h1 { margin: 0; font-size: 24px; }
.page-sub { color: var(--text-muted); margin: -8px 0 18px; }

/* mobilni overlay za sidebar */
.scrim { display: none; }

/* ===================== LOGIN ===================== */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #0E6BA8 0%, #0A527F 100%);
}
.login-card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-modal);
  padding: 36px 32px;
  width: 100%; max-width: 440px;
  text-align: center;
}
.login-card .grb-big { width: 72px; height: 72px; object-fit: contain; margin: 0 auto 12px; display: block; }
.login-card h1 { font-size: 24px; color: var(--brand-dark); letter-spacing: .5px; }
.login-card .slogan { color: var(--text-muted); margin-bottom: 24px; }
.login-card .btn { margin-bottom: 10px; }
.login-lang { margin-top: 18px; display: flex; gap: 10px; justify-content: center; }
.login-lang button {
  background: transparent; border: none; cursor: pointer; font-weight: 700; color: var(--text-muted);
  padding: 4px 8px; border-radius: 6px; font-size: 13px;
}
.login-lang button.active { background: var(--brand-soft); color: var(--brand); }
.demo-note {
  margin-top: 18px; font-size: 13px; color: #9a5e07;
  background: #FBF0DF; border: 1px solid #f0dcb4; border-radius: 8px;
  padding: 8px 12px; display: flex; gap: 8px; align-items: center; justify-content: center;
}

/* ===================== DASHBOARD ===================== */
.dash-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 6px;
}
.dash-card { display: flex; flex-direction: column; gap: 6px; }
.dash-card .label { font-size: 12px; font-weight: 700; letter-spacing: .5px; color: var(--text-muted); }
.dash-card .big { font-size: 30px; font-weight: 700; color: var(--text); }
.dash-card .sub { color: var(--text-muted); font-size: 14px; flex: 1; }
.dash-card .btn { margin-top: 6px; }
.dash-card .label-icon { display: flex; align-items: center; gap: 6px; }

/* ===================== LISTE / REDOVI ===================== */
.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: none; }
/* Klikabilni red kao pravi <button> (pristupačnost: tab-fokus, Enter/Space) */
.row-btn {
  font: inherit; color: inherit; background: transparent;
  border: none; border-bottom: 1px solid var(--border);
  width: 100%; text-align: left; cursor: pointer;
}
.row-btn:last-child { border-bottom: none; }
.row-btn:hover { background: var(--bg); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; }
.row .meta { color: var(--text-muted); font-size: 13px; }
.row .right { text-align: right; white-space: nowrap; }
.row .amount { font-weight: 700; }

/* PLATI lista */
.obaveza-row { cursor: default; }
.obaveza-row.placeno { opacity: .6; }
.obaveza-row input[type=checkbox] {
  width: 20px; height: 20px; accent-color: var(--brand); cursor: pointer; flex: 0 0 auto;
}
.plati-summary {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px; margin-top: 6px; border-top: 2px solid var(--border); gap: 12px;
}
.plati-summary .izabrano { color: var(--text-muted); font-weight: 600; }

/* sanduče lista */
.sanduce-row { cursor: pointer; }
.sanduce-row:hover { background: var(--bg); }
.sanduce-row.novo .title { font-weight: 700; }

/* accordion (Istorija) */
.acc { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 12px; }
.acc-head { background: none; border: none; cursor: pointer; font-weight: 600; color: var(--brand); display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.acc-body { padding: 8px 0 0; }

.empty {
  text-align: center; color: var(--text-muted); padding: 28px 12px;
  background: var(--bg); border: 1px dashed var(--border); border-radius: var(--radius); margin-top: 8px;
}

/* ===================== TABS ===================== */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab {
  background: none; border: none; cursor: pointer; padding: 10px 14px; font-weight: 600;
  color: var(--text-muted); border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--brand-dark); border-bottom-color: var(--brand); }

/* ===================== FORME ===================== */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.field input[type=text], .field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 15px; background: #fff; color: var(--text);
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,107,168,.18);
}
.field.prefilled .pf {
  display: flex; align-items: center; gap: 8px;
  background: var(--brand-soft); border: 1px solid #cfe2f0; border-radius: var(--radius);
  padding: 10px 12px; color: var(--brand-dark); font-weight: 600;
}
.field.prefilled .pf .ok { color: var(--ok); margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.field .hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.field .err { color: var(--danger); font-size: 13px; margin-top: 6px; display: none; }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); }
.field.invalid .err { display: block; }
.req::after { content: " *"; color: var(--danger); }
.file-upload {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border: 1px dashed var(--border); border-radius: var(--radius); color: var(--text-muted);
  background: var(--bg);
}
.taksa-box {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 16px; font-weight: 600;
}
.taksa-box .total { color: var(--brand-dark); }

/* ===================== MODAL ===================== */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15,30,45,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-modal);
  width: 100%; max-width: 420px; overflow: hidden;
  max-height: calc(100vh - 40px); display: flex; flex-direction: column;
}
.modal-head, .modal-foot { flex-shrink: 0; }
.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  font-weight: 700;
}
.modal-head .icon { color: var(--brand); }
.modal-head .spacer { flex: 1; }
.modal-head .x { background: none; border: none; cursor: pointer; font-size: 20px; color: var(--text-muted); line-height: 1; padding: 2px 6px; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
.eid-head { background: #122a3a; color: #fff; border-bottom: none; }
.eid-head .icon { color: #7fc4f0; }

/* radio grupe u modalu */
.radio-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 14px; }
.radio-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.radio-row input { accent-color: var(--brand); width: 18px; height: 18px; }
.pin-row { display: flex; gap: 8px; margin: 6px 0 12px; }
.pin-row input {
  width: 44px; height: 48px; text-align: center; font-size: 22px;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.pin-row input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,107,168,.18); }
.modal-warn { font-size: 13px; color: #9a5e07; background: #FBF0DF; border-radius: 8px; padding: 8px 10px; margin: 6px 0 0; }

/* spinner */
.spinner {
  width: 28px; height: 28px; border: 3px solid var(--brand-soft);
  border-top-color: var(--brand); border-radius: 50%;
  animation: spin .7s linear infinite; margin: 8px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center-col { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 12px 0; }
.success-mark { width: 48px; height: 48px; color: var(--ok); }

/* uspjeh/povratnica box */
.success-box {
  background: #E6F4EC; border: 1px solid #b9e0c8; color: #166b43;
  border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 10px; align-items: flex-start;
}
.success-box .icon { color: var(--ok); flex: 0 0 auto; }
.info-box {
  background: var(--brand-soft); border: 1px solid #cfe2f0; color: var(--brand-dark);
  border-radius: var(--radius); padding: 14px 16px;
}
.warn-box {
  background: #FBF0DF; border: 1px solid #f0dcb4; color: #9a5e07;
  border-radius: var(--radius); padding: 12px 14px; display: flex; gap: 8px; align-items: center;
}

/* ===================== SANDUČE detalj ===================== */
.letter-meta { display: flex; flex-wrap: wrap; gap: 6px 24px; color: var(--text-muted); margin-bottom: 16px; font-size: 14px; }
.letter-body { white-space: pre-wrap; line-height: 1.6; margin: 14px 0; }
.povratnica-box {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 12px 0;
  background: var(--bg);
}

/* ===================== TOAST ===================== */
.toast-wrap {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
}
.toast {
  background: #122a3a; color: #fff; border-radius: 10px; padding: 12px 16px;
  box-shadow: var(--shadow-modal); display: flex; align-items: center; gap: 10px;
  font-weight: 600; max-width: 360px;
  animation: toastin .25s ease;
}
.toast .icon { color: #5fd39a; flex: 0 0 auto; }
@keyframes toastin { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ===================== PRIJAVA 311 ===================== */
.photo-drop {
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: 22px; text-align: center; color: var(--text-muted); cursor: pointer;
  background: var(--bg);
}
.photo-drop:hover { border-color: var(--brand); color: var(--brand); }
.photo-preview { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }
.photo-preview svg { display: block; width: 100%; height: auto; }
/* (V2.4 / 4.8) prava lokalna fotografija (rupa na putu) */
.photo-preview img { display: block; width: 100%; height: auto; max-height: 320px; object-fit: cover; }
.geo-map {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border); cursor: crosshair; user-select: none;
}
/* SAMO direktna pozadinska mapa (mapaSvg) ide 100% — NE i ugniježdene ikone pina */
.geo-map > svg { display: block; width: 100%; height: auto; }
/* (V2.4 / 4.8) online Google Maps embed (view-only); offline → statička .geo-map svg */
.geo-frame { display: block; width: 100%; height: 360px; border: 0; }
@media (max-width: 480px) { .geo-frame { height: 300px; } }
.geo-map.has-frame { cursor: default; }
.map-pin {
  position: absolute; transform: translate(-50%, -100%); z-index: 2;
  color: var(--danger); pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35));
}
.map-pin .icon { width: 30px; height: 30px; }
/* (dorada) online embed: pan/zoom radi, pin fiksiran u SREDINI (Uber-stil) —
   pointer-events:none da ne blokira pomjeranje/zumiranje mape. */
.map-center-pin {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%);
  color: var(--danger); pointer-events: none; z-index: 2;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.45));
}
.map-center-pin .icon { width: 40px; height: 40px; }
.map-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.map-hint .icon { color: var(--brand); width: 14px; height: 14px; flex: 0 0 auto; }

/* INFO/placeholder */
.placeholder-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.news-card .news-img { border-radius: 8px; overflow: hidden; margin-bottom: 10px; }
.news-card .news-img svg { display: block; width: 100%; height: auto; }
.muted { color: var(--text-muted); }
.soon-pill { display: inline-block; font-size: 12px; font-weight: 700; color: var(--text-muted); background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; }

/* ===================== v1.2 — dodatne komponente ===================== */
/* DEMO bedž u top-baru */
.chip-demo { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.35); }

/* Zajednička label u modalima / login PIN-u */
.modal-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }

/* Step-up: kontekstualni razlog (zašto se traži sertifikat) */
.stepup-reason { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 14px; }
.stepup-reason .icon { color: var(--brand); flex: 0 0 auto; margin-top: 2px; }

/* PIN hint (ℹ za demo: 1111) */
.pin-hint { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); margin: 0; }
.pin-hint .icon { color: var(--brand); }
.pin-hint-center { justify-content: center; margin-top: 12px; }

/* Login PIN polja — centrirana */
.login-pin { margin: 6px 0 8px; }
.login-pin .pin-row { justify-content: center; }

/* Popup „Pogrešan PIN" — sloj iznad step-up modala */
.overlay-top { z-index: 130; }
.modal-sm { max-width: 360px; }
.ic-warn .icon { color: var(--warn); }

/* PLATI traka iznad liste (Izaberi obaveze | Saldo) */
.plati-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.plati-choose { font-weight: 700; }
.plati-balance { color: var(--text-muted); font-weight: 600; }
.plati-balance strong { color: var(--brand-dark); }

/* ===================== v1.3 — dodatne komponente ===================== */

/* PLATI — uređivo polje iznosa + „📄 račun" po stavci (djelimično plaćanje) */
.obaveza-pay { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.iznos-field {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 2px 8px;
}
.iznos-field .iznos-lbl { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.iznos-input {
  width: 74px; border: none; outline: none; text-align: right;
  font-size: 14px; font-family: inherit; font-weight: 600; color: var(--text); background: transparent; padding: 6px 0;
}
.iznos-field .eur { color: var(--text-muted); font-weight: 600; }
.iznos-input::-webkit-outer-spin-button, .iznos-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.iznos-input { -moz-appearance: textfield; appearance: textfield; }
.iznos-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,107,168,.18); }
.racun-btn { white-space: nowrap; }
.placene-lista { margin-top: 8px; }

/* Istorija plaćanja — blok po uplati sa stavkama i računima */
.uplata-blok {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 10px; background: var(--bg);
}
.uplata-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.uplata-head .amount { font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.uplata-stavke { margin: 8px 0; border-top: 1px dashed var(--border); padding-top: 8px; }
.uplata-stavka { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.uplata-stavka .grow { flex: 1; min-width: 0; }
.uplata-stavka .amount { font-weight: 600; }
.uplata-akcije { display: flex; gap: 8px; flex-wrap: wrap; }

/* ZAHTJEV — pretraga + čipovi + grupisana lista po kategorijama */
.search-box {
  display: flex; align-items: center; gap: 8px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 0 12px; margin-bottom: 12px;
}
.search-box .icon { color: var(--text-muted); flex: 0 0 auto; }
.search-box input {
  flex: 1; border: none; outline: none; padding: 11px 0;
  font-size: 15px; font-family: inherit; background: transparent; color: var(--text);
}
.search-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,107,168,.18); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip-filter {
  background: var(--bg); border: 1px solid var(--border); color: var(--text-muted);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip-filter:hover { border-color: var(--brand); color: var(--brand); }
.chip-filter.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.cat-section { margin-top: 4px; }
.cat-head {
  font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--text-muted); padding: 14px 4px 4px; border-top: 1px solid var(--border); margin-top: 6px;
}
.cat-section:first-child .cat-head { border-top: none; margin-top: 0; }

/* Detalj predmeta (4.7c) — head, tok (timeline), podaci */
.detalj-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.detalj-head .status-line { display: inline-flex; align-items: center; gap: 8px; }
.detalj-sub { margin: 18px 0 8px; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }

.tok { list-style: none; margin: 4px 0; padding: 0; }
.tok-step { display: flex; gap: 12px; padding: 0 0 16px; position: relative; }
.tok-step:last-child { padding-bottom: 0; }
.tok-step::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--border); }
.tok-step:last-child::before { display: none; }
.tok-mark {
  width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--border); background: var(--surface);
}
.tok-mark.ok { border-color: var(--ok); background: #E6F4EC; color: var(--ok); }
.tok-mark.akt { border-color: var(--brand); background: var(--brand); }
.tok-mark.cek { border-color: var(--border); background: var(--surface); }
.tok-naziv { font-weight: 600; }
.tok-step.tok-ceka .tok-naziv { color: var(--text-muted); }
.tok-datum { font-size: 13px; }

.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.kv { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv-k { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.kv-v { font-weight: 600; word-break: break-word; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
  .hamburger {
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
    color: #fff; border-radius: var(--radius); width: 40px; height: 40px; cursor: pointer;
  }
  .topbar .user .uname { display: none; }
  .sidebar {
    position: fixed; left: 0; top: var(--topbar-h); bottom: 0; height: auto;
    transform: translateX(-100%); transition: transform .22s ease; z-index: 40;
    width: 256px; flex-basis: 256px; box-shadow: var(--shadow-modal);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim {
    display: block; position: fixed; inset: var(--topbar-h) 0 0 0; background: rgba(0,0,0,.35); z-index: 35;
  }
  .main { padding: 18px 16px 40px; }
  .dash-grid { grid-template-columns: 1fr; }
  /* PLATI: pay-kontrole (iznos + račun) padaju u zaseban red da se ne stiskaju */
  .obaveza-row { flex-wrap: wrap; }
  .obaveza-pay { width: 100%; order: 3; justify-content: flex-start; margin-top: 8px; }
  .obaveza-row .right { margin-left: auto; }
}

@media (max-width: 480px) {
  h1 { font-size: 22px; }
  .page-head h1 { font-size: 20px; }
  .main { padding: 14px 12px 36px; }
  .row { flex-wrap: wrap; }
  .obaveza-pay { justify-content: space-between; }
  .kv-grid { grid-template-columns: 1fr; }
  .plati-summary { flex-direction: column; align-items: stretch; }
  .plati-summary .btn { width: 100%; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
  /* toast preko pune širine na dnu → podigni ga iznad plutajućeg dugmeta „Pomoć" (dole-lijevo) */
  .toast-wrap { left: 12px; right: 12px; bottom: 64px; align-items: stretch; }
  .toast { max-width: none; }
  .login-card { padding: 26px 20px; }
}

/* pristupačnost: vidljiv fokus svuda */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(14,107,168,.4); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* =========================================================================
   V2 (SPEC sekcija 12) — registracija, step-up metod, NOTIF, korisnički
   meni, punomoćnik, izdavanje. Iste paleta/komponente kao v1.3.
   ========================================================================= */

/* ---- Login: separator + registracija ---- */
.login-divider { height: 1px; background: var(--border); margin: 18px 0 14px; }
.login-or { display: flex; align-items: center; text-align: center; color: var(--text-muted); font-size: 13px; margin: 16px 0 12px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-or span { padding: 0 12px; }
.login-register { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.login-register .muted { font-size: 13px; }

/* ---- Step-up 6.A: izbor metoda potpisa ---- */
.method-row { font-weight: 600; }
.method-row .icon { color: var(--brand); }
.cert-sub {
  margin: 2px 0 6px 26px; padding-left: 12px;
  border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 2px;
}
.cert-sub .radio-row { font-weight: 400; }
.video-note {
  margin: 0 0 6px 26px; font-size: 13px; color: var(--text-muted);
  display: flex; align-items: flex-start; gap: 6px;
}
.video-note .icon { color: var(--accent); margin-top: 1px; }

/* ---- Registracija (wizard) ---- */
.reg-card { max-width: 460px; text-align: center; }
.reg-step {
  display: inline-block; font-size: 12px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); border-radius: 999px; padding: 3px 12px; margin: 4px 0 12px;
}
.reg-intro { font-size: 14px; color: var(--text-muted); margin: 0 0 14px; line-height: 1.5; }
.reg-h2 { font-size: 18px; margin: 0 0 12px; }
.reg-methods { text-align: left; margin-bottom: 14px; }
.reg-form { text-align: left; }
.reg-vid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.reg-vid-row {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px;
}
.reg-vid-row.done { background: #E6F4EC; border-color: #BFE3CE; }
.reg-vid-row .btn { min-width: 0; }
.reg-vid-status { color: var(--ok); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.reg-done { justify-content: center; }
.reg-donebody { text-align: left; margin: 12px 0; line-height: 1.5; }
.reg-eidas-future { margin-bottom: 14px; text-align: left; }
.reg-back { margin-top: 12px; }

/* small inline spinner (video-koraci) */
.spinner-sm { width: 16px; height: 16px; border-width: 2px; display: inline-block; vertical-align: middle; }

/* ---- NOTIF: zvonce + badge ---- */
.notif-bell { position: relative; }
.bell-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--brand);
}

/* ---- NOTIF panel + korisnički meni (overlay paneli u #modal-root) ---- */
.panel-scrim { position: fixed; inset: 0; z-index: 60; background: transparent; }
.notif-panel, .user-menu {
  position: fixed; top: calc(var(--topbar-h) + 6px); right: 12px; z-index: 61;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-modal); overflow: hidden;
}
.notif-panel { width: 360px; max-width: calc(100vw - 24px); max-height: calc(100vh - var(--topbar-h) - 24px); display: flex; flex-direction: column; }
.notif-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 15px;
}
.notif-list { overflow-y: auto; }
.notif-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 12px 14px; border: none; border-bottom: 1px solid var(--border);
  background: var(--surface); cursor: pointer;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: #F3F8FC; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: transparent; }
.notif-dot.on { background: var(--info); }
.notif-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-text { font-size: 14px; color: var(--text); line-height: 1.35; }
.notif-time { font-size: 12px; color: var(--text-muted); }
.notif-arrow { color: var(--text-muted); flex: 0 0 auto; }
.notif-empty { padding: 28px 14px; color: var(--text-muted); }

.user-menu { width: 240px; max-width: calc(100vw - 24px); padding: 6px; }
.user-menu-head {
  font-size: 13px; color: var(--text-muted); font-weight: 600;
  padding: 8px 10px 6px; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px;
}
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 10px; border: none; background: transparent; border-radius: 8px; cursor: pointer;
  font-size: 14px; color: var(--text);
}
.menu-item:hover { background: var(--bg); }
.user-btn {
  background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius); min-height: 36px; padding: 0 10px; cursor: pointer;
}

/* ---- Punomoćnik (delegirani pristup) ---- */
.rep-current { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 6px; }
.rep-name { display: flex; align-items: center; gap: 6px; font-size: 16px; }
.rep-scope { margin: 12px 0; }
.rep-scope-title { font-size: 13px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.scope-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 14px; }
.scope-row.locked { color: var(--text-muted); }
.scope-box {
  width: 20px; height: 20px; border-radius: 5px; border: 1.5px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.scope-box.on { background: var(--ok); border-color: var(--ok); color: #fff; }

/* ---- Izdavanje (RB90 + boravišna) ---- */
.rent-form .field, .rent-row2 .field { margin-bottom: 12px; }
.rent-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-narrow { max-width: 140px; }
.rent-obracun {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--brand-soft); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px;
}
.rent-total { font-size: 20px; font-weight: 700; color: var(--brand); }
.rent-cat { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.guest-row .dot-ok { width: 9px; height: 9px; }
.tag-sm { font-size: 11px; padding: 1px 6px; }
.big-name { font-size: 18px !important; }

@media (max-width: 480px) {
  .notif-panel { top: var(--topbar-h); right: 0; left: 0; bottom: 0; width: auto; max-width: none; max-height: none; border-radius: 0; border-left: none; border-right: none; }
  .user-menu { top: var(--topbar-h); right: 0; left: auto; }
  .rent-row2 { grid-template-columns: 1fr; }
}

/* =========================================================================
   Korekcije (feedback): poravnanje PLATI kolona, centriran PIN label,
   hint ispod metoda registracije, VI proces na step-up potpisu.
   ========================================================================= */

/* PLATI: fiksna širina desne kolone (iznos + rok/KASNI) → „iznos"/„račun"
   blokovi se poravnaju vertikalno bez obzira na „rok 28.06.2026" vs „KASNI". */
.obaveza-row .right { min-width: 132px; }

/* Login: PIN label centriran iznad polja */
.login-pin-label { text-align: center; }

/* Registracija/potpis: naziv metoda u redu radio-dugmeta */
.method-row span { display: inline-flex; flex-direction: column; line-height: 1.3; }

/* Step-up VI proces: labela koraka lijevo, status desno */
.reg-vid-row .vi-lbl { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.reg-vid-row .vi-lbl .icon { color: var(--brand); }
.reg-vid-ok { color: var(--ok); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }

@media (max-width: 480px) {
  .obaveza-row .right { min-width: 0; }
}

/* =======================================================================
   REŽIM POMOĆI (V2.2 / SPEC sek. 13) — sopstveni sloj napomena, bez biblioteka
   ======================================================================= */

/* Plutajuće dugme „Pomoć" — DOLE-LIJEVO (ne sudara se s toastom 6.D dole-desno).
   z-index ispod modala (100) → transakcioni modali ga prekrivaju. */
.help-fab {
  position: fixed; left: 16px; bottom: 16px; z-index: 96;
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 16px 0 14px;
  background: var(--brand); color: #fff; border: none; border-radius: 999px;
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 14px rgba(14,107,168,.35);
}
.help-fab:hover { background: var(--brand-dark); }
.help-fab.on { background: var(--brand-dark); box-shadow: 0 4px 16px rgba(10,82,127,.45); }
.help-fab:focus-visible { outline: 3px solid rgba(14,107,168,.4); outline-offset: 2px; }
.help-fab-ic { display: inline-flex; }
.help-fab-lbl { white-space: nowrap; }

/* Sloj napomena: prsteni + oblačići. Cijeli sloj NE hvata klik
   (pointer-events:none) → stranica ostaje upotrebljiva i s uključenom pomoći. */
#help-root { position: fixed; inset: 0; z-index: 94; pointer-events: none; }

/* Prsten oko važnog polja — suptilni okvir --brand, BEZ zatamnjenja pozadine. */
.help-ring {
  position: fixed; pointer-events: none; z-index: 1; border-radius: 10px;
  border: 2px solid var(--brand);
  box-shadow: 0 0 0 3px rgba(14,107,168,.18);
  animation: helpFade .18s ease;
}

/* Oblačić-napomena (mala bijela kartica, kratak tekst, strelica ka cilju). */
.help-bubble {
  position: fixed; pointer-events: none; z-index: 2;
  width: 240px; max-width: calc(100vw - 16px);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-left: 3px solid var(--brand);
  border-radius: var(--radius); box-shadow: var(--shadow-modal);
  padding: 9px 12px; animation: helpPop .18s ease;
}
.help-bubble-m { max-width: none; }
.help-rail { width: auto; }
.help-text { font-size: 13px; line-height: 1.45; }

/* Strelica: gore (oblačić ispod cilja) / dole (iznad) / lijevo (rail — desno od cilja). */
.help-arrow { position: absolute; width: 0; height: 0; border-style: solid; }
.help-bubble[data-arrow="up"] .help-arrow {
  top: -7px; border-width: 0 7px 7px 7px;
  border-color: transparent transparent var(--surface) transparent;
}
.help-bubble[data-arrow="down"] .help-arrow {
  bottom: -7px; border-width: 7px 7px 0 7px;
  border-color: var(--surface) transparent transparent transparent;
}
/* (V2.4 / 13.3a) Rail oblačić: tanka strelica ULIJEVO, ka desnoj ivici polja. */
.help-bubble[data-arrow="left"] .help-arrow {
  left: -7px; top: 50%; margin-top: -7px;
  border-width: 7px 7px 7px 0;
  border-color: transparent var(--brand) transparent transparent;
}
/* (V2.4 / 13.3a) Linija-konektor od desne ivice polja do rail-oblačića. */
.help-conn {
  position: fixed; pointer-events: none; z-index: 1;
  height: 2px; background: var(--brand); border-radius: 2px; opacity: .5;
  animation: helpFade .18s ease;
}

@keyframes helpFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes helpPop { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }

/* Jednokratni nagovještaj uz FAB (prvi put; help.hintFirst). */
.help-hint {
  position: fixed; left: 14px; bottom: 66px; z-index: 97;
  max-width: 220px; pointer-events: none;
  background: var(--brand-dark); color: #fff;
  border-radius: var(--radius); box-shadow: var(--shadow-modal);
  padding: 9px 12px; animation: helpPop .2s ease;
}
.help-hint-text { font-size: 13px; line-height: 1.4; font-weight: 600; }
.help-hint-arrow {
  position: absolute; left: 16px; bottom: -6px; width: 0; height: 0;
  border-style: solid; border-width: 6px 6px 0 6px;
  border-color: var(--brand-dark) transparent transparent transparent;
}

/* Mobilni (≤768px): napomena puna širina, ispod svog polja (JS pozicionira). */
@media (max-width: 768px) {
  .help-fab { left: 12px; bottom: 12px; height: 40px; }
  .help-hint { left: 12px; bottom: 60px; }
}
