/* ══════════════════════════════════════════════════════════════
   PIS — Poslovni Informacijski Sustav | style.css
   Design System: Business Application
══════════════════════════════════════════════════════════════ */

/* ── CSS VARIJABLE ─────────────────────────────────────────── */
:root {
  --dk: #1a2332;
  --hd: #2c3e50;
  --ac: #2980b9;
  --ac2: #3498db;
  --sb: #f0f2f5;
  --bd: #d5d8dc;
  --tx: #2c3e50;
  --mt: #7f8c8d;
  --wh: #ffffff;
  --ib: #fafbfc;
  --rh: #eaf2f8;
  --ok: #27ae60;
  --wn: #f39c12;
  --er: #e74c3c;
  /* Density tokens — prilagodba visini prozora */
  --hdr-h: 48px;
  --nav-h: 40px;
  --sbar-h: 26px;
  --pane-p: 16px;
  --base-fs: 13px;
  --row-py: 8px;
  --row-px: 12px;
  --card-hdr-py: 12px;
}

/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: var(--base-fs);
  color: var(--tx);
  background: var(--sb);
  margin: 0;
  padding: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── SCROLLBAR ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--sb); }
::-webkit-scrollbar-thumb { background: #bbb; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #999; }

/* ── ANIMACIJE ────────────────────────────────────────────── */
@keyframes fadeInPane {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

@keyframes slideInToast {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}

@keyframes toastProgressShrink {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

@keyframes slideOutToast {
  from { transform: translateX(0);   opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}

/* ══════════════════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════════════════ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1050;
  height: var(--hdr-h);
  background: linear-gradient(90deg, var(--dk) 0%, var(--hd) 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  padding: 0;
  flex-shrink: 0;
}

.header-logo {
  height: var(--hdr-h);
  display: flex;
  align-items: center;
  padding: 0 20px;
  background: rgba(0,0,0,0.1);
  border-right: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.logo-text {
  color: var(--wh);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 3px;
  line-height: 1;
  user-select: none;
}

.header-center {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
}

.header-info {
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  transition: color 0.15s;
}

.header-info:hover { color: var(--wh); }
.header-info strong { color: rgba(255,255,255,0.95); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 8px;
}

.hdr-btn {
  position: relative;
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.7);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.15s, color 0.15s;
  gap: 6px;
  white-space: nowrap;
}

.hdr-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--wh);
}

.hdr-user { width: auto; padding: 0 8px; }
.hdr-username { font-size: 12px; font-weight: 500; }

.hdr-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--er);
  color: var(--wh);
  font-size: 9px;
  font-weight: 700;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.hdr-separator {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,0.15);
  margin: 0 4px;
}

/* ══════════════════════════════════════════════════════════
   NAVIGACIJA — TABOVI
══════════════════════════════════════════════════════════ */
.app-nav {
  background: var(--wh);
  border-bottom: 1px solid var(--bd);
  height: var(--nav-h);
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.app-nav::-webkit-scrollbar { height: 2px; }

.nav-tabs-list {
  display: flex;
  align-items: stretch;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

.nav-tab-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--mt);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  user-select: none;
}

.nav-tab-item i { font-size: 14px; }

.nav-tab-item:hover {
  color: var(--tx);
  background: var(--sb);
}

.nav-tab-item.active {
  color: var(--ac);
  border-bottom-color: var(--ac);
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════
   MAIN CONTENT AREA
══════════════════════════════════════════════════════════ */
.app-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  min-height: 0;
}

/* ── TAB PANES ──────────────────────────────────────────── */
.tab-pane {
  display: none;
  padding: var(--pane-p);
  animation: fadeInPane 0.2s ease;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Bootstrap row/col — nastavak flex lanca pune visine */
.tab-pane.active > .app-toolbar,
.tab-pane.active > .summary-grid,
.tab-pane.active > .legal-notice,
.tab-pane.active > .stat-cards,
.tab-pane.active > .nav-tabs-list,
.tab-pane.active > [id$='Hint'] {
  flex-shrink: 0;
}

.tab-pane.active > .row:has(.table-scroll-wrap) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
}

.tab-pane.active > .row:has(.table-scroll-wrap) > [class*='col-'] {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tab-pane.active > .card-block:has(.table-scroll-wrap) {
  flex: 1;
  min-height: 0;
}

/* ══════════════════════════════════════════════════════════
   TOOLBAR
══════════════════════════════════════════════════════════ */
.app-toolbar {
  background: var(--wh);
  border-bottom: 1px solid var(--bd);
  padding: 8px 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 calc(-1 * var(--pane-p)) var(--pane-p);
  padding: 8px var(--pane-p);
  flex-shrink: 0;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  justify-content: flex-end;
}

.app-toolbar-split {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.app-toolbar-split .toolbar-left {
  width: 100%;
  flex-wrap: wrap;
}

.app-toolbar-split .toolbar-right {
  width: 100%;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--bd);
}

.app-toolbar-split .tb-search {
  flex: 1 1 220px;
  max-width: 320px;
  width: auto;
}

/* ── TOOLBAR BUTTONS ────────────────────────────────────── */
.tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: auto;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  background: var(--wh);
  border: 1px solid var(--bd);
  border-radius: 4px;
  color: var(--tx);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
  line-height: 1.4;
}

.tb-btn:hover {
  background: var(--sb);
  border-color: #c0c3c6;
}

.tb-btn:active { background: #e8eaed; }

.tb-btn.tb-primary {
  background: var(--ac);
  border-color: var(--ac);
  color: var(--wh);
}
.tb-btn.tb-primary:hover { background: var(--ac2); border-color: var(--ac2); }

.tb-btn.tb-success {
  background: var(--ok);
  border-color: var(--ok);
  color: var(--wh);
}
.tb-btn.tb-success:hover { background: #2ecc71; border-color: #2ecc71; }

.tb-btn.tb-danger {
  background: var(--er);
  border-color: var(--er);
  color: var(--wh);
}
.tb-btn.tb-danger:hover { background: #c0392b; border-color: #c0392b; }

.tb-separator {
  width: 1px;
  height: 24px;
  background: var(--bd);
  margin: 0 6px;
  flex-shrink: 0;
}

/* ── SEARCH BOX ─────────────────────────────────────────── */
.tb-search {
  position: relative;
  max-width: 260px;
  width: 220px;
}

.tb-search-icon {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mt);
  font-size: 13px;
  pointer-events: none;
}

.tb-search-input {
  width: 100%;
  height: 32px;
  padding: 0 10px 0 30px;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid var(--bd);
  border-radius: 4px;
  background: var(--ib);
  color: var(--tx);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tb-search-input:focus {
  border-color: var(--ac);
  box-shadow: 0 0 0 3px rgba(41,128,185,0.12);
  background: var(--wh);
}

.tb-select {
  height: 32px;
  padding: 0 8px;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid var(--bd);
  border-radius: 4px;
  background: var(--ib);
  color: var(--tx);
  cursor: pointer;
  outline: none;
}

.tb-select:focus {
  border-color: var(--ac);
  box-shadow: 0 0 0 3px rgba(41,128,185,0.12);
}

.tb-filter {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
}

.tb-date {
  width: 140px;
}

.tb-date .date-inp {
  height: 32px;
  font-size: 12px;
  width: 100%;
}

.tb-date .input-btn {
  height: 32px;
  width: 32px;
}

/* ══════════════════════════════════════════════════════════
   KARTICE
══════════════════════════════════════════════════════════ */
.card-block {
  background: var(--wh);
  border: 1px solid var(--bd);
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.card-block-header {
  padding: var(--card-hdr-py) 16px;
  border-bottom: 1px solid var(--bd);
  font-weight: 600;
  font-size: 14px;
  background: #fdfdfd;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-radius: 6px 6px 0 0;
  flex-shrink: 0;
}

.card-block-header i {
  color: var(--ac);
  margin-right: 8px;
  font-size: 16px;
}

.card-block-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.card-block-body .table-scroll-wrap {
  flex: 1;
  min-height: 0;
}

/* ══════════════════════════════════════════════════════════
   FORME
══════════════════════════════════════════════════════════ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 0;
}

.form-field { display: flex; flex-direction: column; }

.ura-shema-konto-row {
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

.ura-shema-konto-helpers {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--mt);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.form-inp {
  border: 1px solid var(--bd);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  background: var(--ib);
  color: var(--tx);
  height: 34px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  width: 100%;
}

.form-inp:focus {
  border-color: var(--ac);
  box-shadow: 0 0 0 3px rgba(41,128,185,0.12);
  background: var(--wh);
}

.form-inp[readonly] {
  background: #eef0f2;
  color: var(--mt);
  cursor: default;
}

.form-inp.error { border-color: var(--er); }
.form-err { font-size: 10px; color: var(--er); margin-top: 2px; }

select.form-inp { cursor: pointer; }

/* ── Input s gumbom (npr. odabir partnera iz popup prozora) ─ */
.input-with-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.input-with-btn .form-inp { flex: 1; min-width: 0; }

/* Skriveni native date picker — kalendar se pozicionira uz gumb, bez fokusa u tab redoslijedu */
.date-native {
  position: absolute;
  right: 2px;
  bottom: 0;
  width: 34px;
  height: 1px;
  opacity: 0;
  border: 0;
  padding: 0;
  margin: 0;
  pointer-events: none;
}

.input-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: 1px solid var(--bd);
  border-radius: 4px;
  background: var(--wh);
  color: var(--ac);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, border-color 0.12s;
}

.input-btn:hover { background: var(--sb); border-color: var(--ac); }
.input-btn:disabled,
.input-btn:disabled:hover {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--bg2, #f1f3f5);
  border-color: var(--bd, #dee2e6);
}
.form-inp:disabled {
  background: var(--bg2, #f1f3f5);
  color: var(--tx2, #868e96);
  cursor: not-allowed;
}

/* ══════════════════════════════════════════════════════════
   TABLICE
══════════════════════════════════════════════════════════ */
.table-scroll-wrap {
  overflow-x: auto;
  overflow-y: auto;
  width: 100%;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  font-size: var(--base-fs);
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.data-table thead th {
  background: #f5f6f8;
  padding: var(--row-py) var(--row-px);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--mt);
  border-bottom: 2px solid var(--bd);
  white-space: nowrap;
  user-select: none;
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px 0 var(--bd);
}

.data-table thead th.sortable { cursor: pointer; }
.data-table thead th.sortable:hover { color: var(--tx); background: #eceef1; }
.sort-icon { font-size: 9px; opacity: 0.5; margin-left: 2px; }

.data-table tbody td {
  padding: var(--row-py) var(--row-px);
  border-bottom: 1px solid #eef0f2;
  white-space: nowrap;
}

.data-table tbody tr.selectable { cursor: pointer; }
.data-table tbody tr.selectable:hover td { background: var(--rh); }
.data-table tbody tr.selected td { background: #d4e6f1; }

/* Konto picker — dugi nazivi se lome, bez horizontalnog scrolla */
#modalKontoPicker .table-scroll-wrap {
  overflow-x: hidden;
  overflow-y: auto;
}
#kpPickerTable {
  table-layout: fixed;
  width: 100%;
}
#kpPickerTable th:nth-child(1),
#kpPickerTable td:nth-child(1) {
  width: 90px;
  white-space: nowrap;
}
#kpPickerTable th:nth-child(2),
#kpPickerTable td:nth-child(2) {
  width: auto;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
#kpPickerTable th:nth-child(3),
#kpPickerTable td:nth-child(3) {
  width: 90px;
  white-space: nowrap;
}

/* Stornirani redovi */
.data-table tbody tr.storno td {
  opacity: 0.45;
  text-decoration: line-through;
}
.data-table tbody tr.storno:hover td { background: var(--rh); }

/* Desno poravnanje */
.data-table td.tr,
.data-table th.tr {
  text-align: right;
}

/* Footer tablice */
.data-table tfoot tr.table-footer td {
  padding: 8px 12px;
  font-weight: 700;
  border-top: 2px solid var(--bd);
  background: #f9fafb;
  font-size: 12px;
}

/* Paginacija */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-top: 1px solid var(--bd);
  font-size: 12px;
  color: var(--mt);
  background: var(--ib);
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.page-info { flex-shrink: 0; }

.page-btns {
  display: flex;
  align-items: center;
  gap: 2px;
}

.page-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid var(--bd);
  border-radius: 4px;
  background: var(--wh);
  color: var(--tx);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}

.page-btn:hover { background: var(--sb); }
.page-btn.active {
  background: var(--ac);
  border-color: var(--ac);
  color: var(--wh);
  font-weight: 600;
}

.page-ellipsis { padding: 0 4px; color: var(--mt); }

.page-size {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   STATUS BADGE-OVI
══════════════════════════════════════════════════════════ */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  cursor: default;
  transition: filter 0.12s;
}

.badge-status.clickable,
.badge-status[onclick] { cursor: pointer; }
.badge-status[onclick]:hover { filter: brightness(0.92); }

.badge-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-status.status-ok  { background: #e8f8f0; color: var(--ok); }
.badge-status.status-warn{ background: #fef9e7; color: var(--wn); }
.badge-status.status-err { background: #fdedec; color: var(--er); }

.tem-foot-ok   { background: #e8f8f0; transition: background .2s; }
.tem-foot-warn { background: #fef9e7; transition: background .2s; }

#temStavkeTable tfoot td { position: sticky; bottom: 0; z-index: 3; background: inherit; }
#temStavkeFoot td { background: #eef7ef; }
#temStavkeFoot.tem-foot-ok td { background: #e8f8f0; }
#temStavkeFoot.tem-foot-warn td { background: #fef9e7; }

/* ══════════════════════════════════════════════════════════
   ZAKONSKA NAPOMENA
══════════════════════════════════════════════════════════ */
.legal-notice {
  background: #fef9e7;
  border: 1px solid #f9e79f;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 12px;
  color: #7d6608;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.5;
  margin-bottom: 16px;
}

.legal-notice > i {
  font-size: 18px;
  margin-top: 1px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   PRETPOREZ UPOZORENJE
══════════════════════════════════════════════════════════ */
.pretporez-warning {
  background: #fdedec;
  border: 1px solid #f5b7b1;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--er);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.pretporez-warning i { font-size: 15px; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════
   SUMMARY KARTICE (KPI)
══════════════════════════════════════════════════════════ */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.summary-card {
  background: var(--wh);
  border: 1px solid var(--bd);
  border-radius: 6px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.summary-label {
  font-size: 12px;
  color: var(--mt);
  font-weight: 500;
}

.summary-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--tx);
  font-variant-numeric: tabular-nums;
}

.summary-value.accent { color: var(--ac); }

/* ══════════════════════════════════════════════════════════
   PROGRESS BAROVI
══════════════════════════════════════════════════════════ */
.progress-row { }

.progress-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--mt);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.progress-bar-container {
  background: #eef0f2;
  border-radius: 4px;
  height: 24px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease;
}

.progress-fill-live {
  transition: width 0.25s ease;
}

/* Boja ovisno o vrijednosti */
.progress-fill[data-value] { background: var(--ok); }

.progress-fill[data-value="79"],
.progress-fill[data-value="84"] { background: var(--wn); }

/* >80% */
.progress-fill[data-value="84"] { background: var(--er); }

/* ══════════════════════════════════════════════════════════
   STATUS BAR
══════════════════════════════════════════════════════════ */
.app-statusbar {
  position: relative;
  height: var(--sbar-h);
  background: var(--hd);
  color: rgba(255,255,255,0.6);
  font-size: 11px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1040;
  flex-shrink: 0;
}

.statusbar-left,
.statusbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sb-sep {
  opacity: 0.3;
  margin: 0 2px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  display: inline-block;
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   MODALI
══════════════════════════════════════════════════════════ */
.app-modal {
  border: none;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-modal > .modal-header,
.app-modal > .modal-footer {
  flex-shrink: 0;
}

.app-modal > .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.modal-dialog.modal-dialog-scrollable {
  max-height: calc(100vh - 40px);
}

.app-modal-header {
  background: #f8f9fa;
  border-bottom: 1px solid var(--bd);
  padding: 14px 20px;
}

.app-modal-header .modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--tx);
}

.modal-body { padding: 20px; }

.app-modal-footer {
  border-top: 1px solid var(--bd);
  padding: 12px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--mt);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--bd);
}

/* ══════════════════════════════════════════════════════════
   GUSTI UNOS — URA / IRA (desktop-stil kao Synesis)
══════════════════════════════════════════════════════════ */
.modal-entry-dense {
  max-width: min(1100px, calc(100vw - 24px));
}

.modal-entry-dense .app-modal {
  max-height: calc(100vh - 24px);
}

.modal-entry-dense .modal-body {
  padding: 8px 12px;
}

.modal-entry-dense .app-modal-header {
  padding: 8px 12px;
}

.modal-entry-dense .app-modal-footer {
  padding: 6px 12px;
}

.modal-entry-dense .modal-section-title {
  display: none;
}

.dense-section-sep {
  font-size: 11px;
  font-weight: 700;
  color: var(--mt);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--bd);
  margin: 4px 0 4px;
  padding-bottom: 2px;
}

.dense-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 4px 10px;
  margin-bottom: 4px;
}

.dense-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  flex: 0 1 auto;
  min-width: 0;
}

.dense-field .form-lbl {
  margin-bottom: 0;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.dense-field > .form-inp,
.dense-field > select.form-inp {
  width: 100%;
  min-width: 0;
}

.dense-field .input-with-btn {
  width: 100%;
  min-width: 0;
  display: flex;
}

.dense-field .input-with-btn .form-inp {
  min-width: 0;
  width: 100%;
  flex: 1;
}

.dense-field-grow {
  flex: 1 1 160px;
  min-width: 120px;
}

.dense-field-w-xs { flex: 0 0 auto; width: 72px; }
.dense-field-w-xs > .form-inp,
.dense-field-w-xs .input-with-btn { width: 100%; flex: none; }

.dense-field-w-sm { flex: 0 0 auto; width: 108px; }
.dense-field-w-sm > .form-inp,
.dense-field-w-sm .input-with-btn { width: 100%; flex: none; }

.dense-field-w-md { flex: 0 0 auto; width: 130px; }
.dense-field-w-md > .form-inp,
.dense-field-w-md > select.form-inp,
.dense-field-w-md .input-with-btn { width: 100%; flex: none; }

.dense-field-w-lg { flex: 1 1 200px; min-width: 160px; }

.modal-entry-dense .form-inp,
.modal-entry-dense select.form-inp {
  height: 26px;
  font-size: 12px;
  padding: 2px 6px;
}

.modal-entry-dense .input-btn {
  width: 26px;
  height: 26px;
  font-size: 12px;
  flex-shrink: 0;
}

.modal-entry-dense .date-native {
  width: 26px;
}

.modal-entry-dense .form-grid.mb-3,
.modal-entry-dense .mb-3 {
  margin-bottom: 4px !important;
}

.modal-entry-dense .form-text {
  display: block;
  font-size: 10px;
  line-height: 1.2;
  margin: 0;
  color: var(--mt);
}

.modal-entry-dense .ura-shema-konto-helpers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  width: 100%;
  flex-basis: 100%;
}

.modal-entry-dense .form-check {
  margin: 0;
  padding-left: 1.25em;
  font-size: 11px;
  white-space: nowrap;
}

.modal-entry-dense .form-check-label {
  font-size: 11px;
}

.modal-entry-dense .table-scroll-wrap {
  flex: none;
  overflow: visible;
}

.modal-entry-dense .data-table thead th {
  padding: 3px 6px;
  font-size: 10px;
}

.modal-entry-dense .data-table tbody td {
  padding: 2px 4px;
  font-size: 11px;
}

.modal-entry-dense .data-table tbody td .form-inp {
  height: 24px;
  font-size: 11px;
  padding: 1px 4px;
}

.modal-entry-dense #uraKalkulacijaWrap .dense-section-sep,
.modal-entry-dense #uraKalkulacijaWrap .modal-section-title {
  display: block;
  margin-top: 6px;
}

.modal-entry-dense #uraKalkulacijaWrap .modal-section-title {
  font-size: 11px;
  margin-bottom: 4px;
  padding-bottom: 2px;
}

/* URA Postavke — kompaktno, bez scrolla (1366×768) */
#modalUraPostavke .modal-dialog {
  max-width: min(920px, calc(100vw - 24px));
}

#modalUraPostavke .ura-postavke-body {
  overflow: visible !important;
  padding: 6px 12px 8px;
}

#modalUraPostavke .ura-postavke-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  align-items: start;
}

#modalUraPostavke .ura-postavke-col {
  min-width: 0;
}

#modalUraPostavke .ura-postavke-intro {
  margin-bottom: 4px;
  line-height: 1.25;
}

#modalUraPostavke .ura-postavke-hdr,
#modalUraPostavke .ura-postavke-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.95fr) minmax(90px, 1.5fr) 44px;
  gap: 4px 6px;
  align-items: center;
}

#modalUraPostavke .ura-postavke-hdr {
  font-size: 9px;
  font-weight: 700;
  color: var(--mt);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--bd);
}

#modalUraPostavke .ura-postavke-row {
  margin-bottom: 2px;
}

#modalUraPostavke .ura-postavke-row .form-lbl {
  margin-bottom: 0;
  font-size: 10px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#modalUraPostavke .ura-postavke-row .form-inp,
#modalUraPostavke .ura-postavke-strana {
  height: 26px;
  font-size: 11px;
  padding: 2px 6px;
}

#modalUraPostavke .ura-postavke-strana {
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
}

#modalUraPostavke .ura-postavke-row .input-btn {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

#modalUraPostavke .app-modal-header {
  padding: 6px 12px;
}

#modalUraPostavke .app-modal-footer {
  padding: 5px 12px;
}

/* Modal unos temeljnice — 1366×768 / 1366x766 */
.modal-tem-entry {
  max-width: min(1340px, calc(100vw - 20px));
  width: calc(100vw - 20px);
  margin: 10px auto;
}

.modal-tem-entry .modal-content {
  max-height: calc(100vh - 20px);
  display: flex;
  flex-direction: column;
}

#modalTem:not(.modal-tem--view) .modal-tem-entry .modal-content {
  height: calc(100vh - 20px);
  max-height: calc(100vh - 20px);
}

.modal-tem-entry .modal-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 16px;
}

#modalTem:not(.modal-tem--view) .modal-tem-entry .modal-content.app-modal > .modal-body {
  overflow: hidden;
}

.modal-tem-entry.modal-entry-dense .modal-body {
  padding: 8px 12px;
}

.modal-tem-entry.modal-entry-dense .app-modal-header {
  padding: 8px 12px;
}

.modal-tem-entry.modal-entry-dense .app-modal-footer {
  padding: 6px 12px;
}

.modal-tem-entry .tem-stavke-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.modal-tem-entry .tem-stavke-section-head .tem-stavke-search-inp {
  flex-shrink: 0;
}

.modal-tem-entry .tem-stavke-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.modal-tem-entry .tem-stavke-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  position: relative;
  border: 1px solid var(--bd, #dee2e6);
  border-radius: 4px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.modal-tem-entry .tem-stavke-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.modal-tem-entry .tem-stavke-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
}

.modal-tem-entry .tem-stavke-scroll::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-height: 800px) {
  .modal-tem-entry {
    margin: 6px auto;
  }
  .modal-tem-entry .modal-content {
    max-height: calc(100vh - 12px);
  }
  .modal-tem-entry .modal-body {
    padding: 8px 14px;
  }
  .modal-tem-entry.modal-entry-dense .modal-body {
    padding: 6px 10px;
  }
  .modal-tem-entry .modal-section-title {
    margin-bottom: 4px;
    padding-bottom: 2px;
  }
  .modal-tem-entry .form-grid {
    margin-bottom: 6px !important;
  }
  .modal-tem-entry .tem-entry-row {
    padding: 4px 6px;
    margin-bottom: 6px;
  }
  .modal-tem-entry .modal-footer {
    padding: 6px 14px;
  }
}

.tem-stavke-table thead th {
  position: sticky;
  top: 0;
  background-color: #f8f9fa !important;
  z-index: 5;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.tem-stavke-table tfoot {
  position: sticky;
  bottom: 0;
  z-index: 5;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.08);
}

.tem-stavke-table tfoot tr td {
  background-color: #f8f9fa !important;
  border-top: 2px solid #dee2e6 !important;
}

.tem-stavke-search-inp {
  height: 26px;
  font-size: 12px;
  width: 200px;
}

.tem-entry-row {
  display: grid;
  grid-template-columns: 112px 100px 140px 1fr 1fr 110px 110px 120px;
  gap: 4px;
  align-items: flex-end;
  padding: 6px;
  margin-bottom: 6px;
  background: #f8f9fa;
  border: 1px solid var(--bd, #dee2e6);
  border-radius: 4px;
}

.tem-entry-row.tem-entry-row--edit {
  grid-template-columns: 112px 100px 140px 1fr 1fr 110px 110px 190px;
}

.tem-entry-cell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  min-width: 0;
}

.tem-entry-cell .form-lbl {
  margin-bottom: 0;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.tem-entry-btn {
  align-self: end;
}

.tem-entry-row .form-inp {
  height: 26px;
  font-size: 12px;
  width: 100%;
  min-width: 0;
}

.tem-entry-row .input-with-btn {
  width: 100%;
}

.tem-entry-row .input-btn {
  width: 26px;
  height: 26px;
  font-size: 12px;
}

.tem-entry-commit-btn {
  height: 26px;
  font-size: 11px;
  white-space: nowrap;
  padding: 0 8px;
  width: 100%;
}

.modal-tem-entry.modal-entry-dense .tem-entry-row .tb-btn {
  height: 26px;
  font-size: 11px;
  padding: 0 8px;
  line-height: 1.2;
}

.modal-tem--view #temEntryForm {
  display: none !important;
}

.modal-tem--view .tem-stavke-actions-col {
  display: none !important;
}

.modal-tem--view .tem-drag-handle {
  display: none;
}

.modal-tem--view .modal-body .form-inp:not(.tem-stavke-search-inp),
.modal-tem--view .modal-body select.form-inp {
  pointer-events: none;
  background: var(--bg-muted, #f5f5f5);
}

.modal-tem--view .input-btn {
  display: none;
}

#modalTem.modal-tem--view .modal-dialog.modal-tem-entry {
  width: calc(100vw - 20px);
  max-width: min(1340px, calc(100vw - 20px));
}

#modalTem.modal-tem--view .modal-content {
  height: auto;
  max-height: calc(100vh - 24px);
}

#modalTem.modal-tem--view .modal-body {
  flex: 0 1 auto;
  overflow: visible;
}

#modalTem.modal-tem--view .tem-stavke-panel {
  flex: 0 1 auto;
}

#modalTem.modal-tem--view .tem-stavke-scroll {
  flex: 0 1 auto;
  max-height: min(60vh, calc(100vh - 280px));
  overflow-y: auto;
  scrollbar-width: thin;
}

.tem-status-val {
  display: flex;
  align-items: center;
  min-height: 26px;
  background: var(--bg-muted, #f5f5f5);
  pointer-events: none;
}

.tem-footer-edit,
.tem-footer-view {
  display: none !important;
}

#modalTem:not(.modal-tem--view) .tem-footer-edit {
  display: flex !important;
}

#modalTem.modal-tem--view .tem-footer-view {
  display: flex !important;
}

.tem-autosave-status {
  min-height: 1.25rem;
  white-space: nowrap;
}

.tem-autosave-status.is-saving {
  color: var(--tx-muted, #6c757d);
}

.tem-autosave-status.is-saved {
  color: var(--ok, #198754);
}

.tem-autosave-status.is-error {
  color: var(--danger, #dc3545);
}

#temStavkeTable tbody tr.tem-stavke-empty td {
  font-size: 12px;
}

.tem-rbr-cell {
  white-space: nowrap;
  padding-left: 4px !important;
  padding-right: 4px !important;
}

.tem-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 28px;
  margin-right: 2px;
  color: #adb5bd;
  cursor: grab;
  vertical-align: middle;
}

.tem-drag-handle:active {
  cursor: grabbing;
}

.tem-rbr-num {
  display: inline-block;
  min-width: 1.2em;
  font-size: 12px;
  vertical-align: middle;
}

.sortable-ghost {
  opacity: 0.45;
  background: #fff3cd !important;
}

.sortable-fallback {
  opacity: 0.9;
  background: #fff3cd !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000;
}

@media (max-width: 1100px) {
  .tem-entry-row {
    grid-template-columns: 1fr 1fr;
  }
  .tem-entry-naziv,
  .tem-entry-opis {
    grid-column: span 2;
  }
  .tem-entry-actions {
    grid-column: span 2;
  }
}

/* ══════════════════════════════════════════════════════════
   TOAST OBAVIJESTI
══════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: 60px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  background: var(--wh);
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 12px 20px 15px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  max-width: 380px;
  min-width: 280px;
  border-left: 4px solid;
  animation: slideInToast 0.3s ease forwards;
  pointer-events: all;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.toast-body {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.toast-item.slide-out {
  animation: slideOutToast 0.3s ease forwards;
}

.toast-item.toast-success { border-left-color: var(--ok); }
.toast-item.toast-info    { border-left-color: var(--ac); }
.toast-item.toast-warning { border-left-color: var(--wn); }
.toast-item.toast-error   { border-left-color: var(--er); }

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-item.toast-success .toast-icon { color: var(--ok); }
.toast-item.toast-info    .toast-icon { color: var(--ac); }
.toast-item.toast-warning .toast-icon { color: var(--wn); }
.toast-item.toast-error   .toast-icon { color: var(--er); }

.toast-content { flex: 1; min-width: 0; }
.toast-title { font-weight: 600; color: var(--tx); margin-bottom: 2px; }
.toast-msg   { color: var(--mt); font-size: 12px; line-height: 1.4; }

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.06);
}

.toast-progress-bar {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  animation: toastProgressShrink linear forwards;
}

.toast-item.toast-success .toast-progress-bar { background: var(--ok); }
.toast-item.toast-info    .toast-progress-bar { background: var(--ac); }
.toast-item.toast-warning .toast-progress-bar { background: var(--wn); }
.toast-item.toast-error   .toast-progress-bar { background: var(--er); }

/* ══════════════════════════════════════════════════════════
   CHECKBOX
══════════════════════════════════════════════════════════ */
.app-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--ac);
  cursor: pointer;
  vertical-align: middle;
}

/* ══════════════════════════════════════════════════════════
   ACTION BUTTONS (u tablicama)
══════════════════════════════════════════════════════════ */
.action-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--bd);
  border-radius: 4px;
  background: var(--wh);
  color: var(--mt);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
  margin-left: 2px;
}

.action-btn:hover {
  background: var(--sb);
  color: var(--tx);
}

/* ══════════════════════════════════════════════════════════
   FORMA U MODALIMA — TR klasa za desno poravnanje inputa
══════════════════════════════════════════════════════════ */
.form-inp.tr { text-align: right; }

/* ══════════════════════════════════════════════════════════
   DENSITY — automatska prilagodba visini + ručni kompaktni prikaz
══════════════════════════════════════════════════════════ */
@media (max-height: 900px) {
  :root {
    --hdr-h: 42px;
    --nav-h: 34px;
    --pane-p: 10px;
    --base-fs: 12px;
    --row-py: 5px;
    --card-hdr-py: 8px;
  }

  .app-modal > .modal-body,
  .modal-body {
    padding: 12px 16px;
  }

  .modal-section-title {
    margin-bottom: 6px;
    padding-bottom: 4px;
  }

  .app-modal .form-grid.mb-3 {
    margin-bottom: 0.5rem !important;
  }

  .app-modal .form-inp,
  .app-modal .input-btn {
    height: 30px;
  }

  .app-modal-header,
  .app-modal-footer {
    padding-top: 8px;
    padding-bottom: 8px;
  }
}

@media (max-height: 780px) {
  :root {
    --hdr-h: 38px;
    --nav-h: 30px;
    --pane-p: 8px;
    --base-fs: 12px;
    --row-py: 3px;
    --card-hdr-py: 6px;
  }
}

body.density-compact {
  --hdr-h: 38px;
  --nav-h: 30px;
  --pane-p: 8px;
  --base-fs: 12px;
  --row-py: 3px;
  --card-hdr-py: 6px;
}

body.density-compact .app-modal > .modal-body,
body.density-compact .modal-body {
  padding: 12px 16px;
}

body.density-compact .modal-section-title {
  margin-bottom: 6px;
  padding-bottom: 4px;
}

body.density-compact .app-modal .form-grid.mb-3 {
  margin-bottom: 0.5rem !important;
}

body.density-compact .app-modal .form-inp,
body.density-compact .app-modal .input-btn {
  height: 30px;
}

body.density-compact .app-modal-header,
body.density-compact .app-modal-footer {
  padding-top: 8px;
  padding-bottom: 8px;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — kompaktna prilagodba
══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .header-center { display: none; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr 1fr; }

  .app-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-left,
  .toolbar-right {
    width: 100%;
    justify-content: flex-start;
  }

  .tb-search {
    max-width: 100%;
    width: 100%;
    flex: 1 1 100%;
  }

  .tb-filter {
    flex: 1 1 calc(50% - 4px);
    min-width: 120px;
  }

  .tb-filter.ms-2 { margin-left: 0 !important; }

  .tb-filter .tb-select,
  .tb-date {
    width: 100%;
  }

  .card-block-header .ms-auto { margin-left: 0 !important; }

  .data-table { font-size: 12px; }

  .data-table thead th,
  .data-table tbody td {
    padding: 6px 8px;
  }

  .data-table tbody td:nth-child(4),
  .data-table thead th:nth-child(4) {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .table-scroll-wrap {
    border-bottom: 1px solid #eef0f2;
  }
}

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }

  .app-toolbar {
    flex-direction: column;
    align-items: stretch;
    margin: 0 -12px 12px;
    padding: 8px 12px;
  }

  .toolbar-left,
  .toolbar-right { width: 100%; }

  .tb-search { max-width: 100%; width: 100%; }

  .tb-filter { flex: 1 1 100%; }

  .toolbar-left .tb-btn:not(.tb-primary) {
    padding: 6px 8px;
    font-size: 0;
    gap: 0;
  }

  .toolbar-left .tb-btn:not(.tb-primary) i {
    font-size: 14px;
  }

  .toolbar-left .tb-separator { display: none; }

  .summary-grid { grid-template-columns: repeat(2, 1fr); }

  .hdr-username { display: none; }

  .app-header,
  .header-logo { height: 44px; }

  .header-logo { padding: 0 12px; }

  .logo-text { font-size: 18px; letter-spacing: 2px; }

  .header-actions { padding: 0 4px; }

  .tab-pane { padding: 12px; }
}

/* ══════════════════════════════════════════════════════════
   TOOLBAR — DIN INPUT
══════════════════════════════════════════════════════════ */
.tb-din-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--mt);
  white-space: nowrap;
}

.tb-din-input {
  height: 32px;
  width: 70px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid var(--bd);
  border-radius: 4px;
  background: var(--ib);
  color: var(--tx);
  text-align: center;
}

/* ══════════════════════════════════════════════════════════
   IRA DOCUMENT FORMA
══════════════════════════════════════════════════════════ */
.ira-doc {
  background: var(--wh);
  border: 1px solid var(--bd);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  overflow: hidden;
}

/* ── Zajednički mixin za sekicje ─────────────────────────── */
.ira-section {
  padding: 8px 16px 10px;
  border-bottom: 1px solid #e8eaed;
}

.ira-section-last { border-bottom: none; }

.ira-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--tx);
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Zaglavlje dokumenta ─────────────────────────────────── */
.ira-doc-header {
  padding: 8px 16px 10px;
  border-bottom: 1px solid #e8eaed;
}

.ira-title-row {
  margin-bottom: 4px;
}

.ira-doc-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--tx);
}

.ira-brdate-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.ira-field-group {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.ira-smiley {
  font-size: 28px;
  line-height: 1;
  cursor: default;
  user-select: none;
  margin-bottom: 2px;
  flex-shrink: 0;
}

/* ── Polja labela+input ──────────────────────────────────── */
.ira-field-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ira-field-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--mt);
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}

.ira-input {
  border: none;
  border-bottom: 1px solid var(--bd);
  border-radius: 0;
  padding: 3px 4px;
  font-size: 13px;
  font-family: inherit;
  background: transparent;
  color: var(--tx);
  height: 26px;
  outline: none;
  transition: border-color 0.15s;
  min-width: 0;
  width: 100%;
}

.ira-input:focus {
  border-bottom-color: var(--ac);
  background: rgba(41,128,185,0.04);
}

.ira-input[readonly] {
  color: var(--mt);
  cursor: default;
}

.ira-input.ira-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Broj polja — veći font s crvenom podvlakom */
.ira-input.ira-input-num {
  font-size: 20px;
  font-weight: 400;
  border-bottom: 2px solid var(--er);
  width: 80px;
}

.ira-input.ira-input-date {
  font-size: 18px;
  font-weight: 400;
  border-bottom: 2px solid var(--er);
  width: 150px;
}

/* ── Kupac red ───────────────────────────────────────────── */
.ira-kupac-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── eURA scan dugme ─────────────────────────────────────── */
.ira-eura-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid var(--bd);
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  background: var(--wh);
  transition: background 0.12s, border-color 0.12s;
  min-width: 80px;
  margin-bottom: 0;
  flex-shrink: 0;
}

.ira-eura-btn:hover {
  background: var(--sb);
  border-color: var(--ac);
}

.ira-qr-icon { line-height: 1; }

.ira-eura-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--mt);
  white-space: nowrap;
}

/* ── Valuta + Račun — inline row ─────────────────────────── */
.ira-inline-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.ira-racun-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Lookup polje (key icon + tekst) ─────────────────────── */
.ira-lookup-field {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--bd);
  height: 26px;
  padding: 0 4px;
  cursor: pointer;
  font-size: 13px;
  color: var(--tx);
  transition: border-color 0.12s, background 0.12s;
  min-width: 0;
  white-space: nowrap;
}

.ira-lookup-field:hover {
  border-bottom-color: var(--ac);
  background: rgba(41,128,185,0.04);
}

.ira-key-icon {
  color: #b8860b;
  font-size: 12px;
  flex-shrink: 0;
}

/* ── Tool button (Valuta, VIES) ──────────────────────────── */
.ira-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  background: var(--wh);
  border: 1px solid var(--bd);
  border-radius: 4px;
  color: var(--tx);
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
  height: 26px;
  flex-shrink: 0;
}

.ira-tool-btn:hover { background: var(--sb); }
.ira-tool-btn i { color: #b8860b; font-size: 13px; }

/* ── PDV mini tablica ────────────────────────────────────── */
.ira-pdv-wrap {
  display: inline-block;
}

.ira-pdv-table {
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.ira-pdv-table thead th {
  background: #d6e4f0;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--tx);
  border: 1px solid #aec6d8;
  text-align: left;
}

.ira-pdv-table tbody td {
  padding: 2px 4px;
  border: 1px solid #c8d8e4;
  background: var(--wh);
}

.ira-pdv-stopa {
  font-size: 13px;
  color: var(--tx);
  padding: 3px 8px !important;
  white-space: nowrap;
  background: #eef5fb !important;
}

.ira-pdv-inp {
  border: none;
  border-bottom: 1px solid transparent;
  background: transparent;
  font-size: 13px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
  width: 90px;
  padding: 2px 4px;
  color: var(--tx);
  outline: none;
  height: 24px;
}

.ira-pdv-inp:focus {
  border-bottom-color: var(--ac);
  background: rgba(41,128,185,0.04);
}

.ira-pdv-inp[readonly] { color: var(--mt); cursor: default; }

/* ── Plaćeno tablica ─────────────────────────────────────── */
.ira-placeno-counter {
  font-size: 11px;
  font-weight: 500;
  color: var(--mt);
}

.ira-placeno-wrap {
  display: inline-flex;
  flex-direction: column;
  border: 1px solid #aec6d8;
  border-radius: 2px;
  overflow: hidden;
  min-width: 200px;
  max-width: 300px;
}

.ira-placeno-table {
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  width: 100%;
}

.ira-placeno-table thead th {
  background: #d6e4f0;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--tx);
  border-bottom: 1px solid #aec6d8;
  text-align: left;
}

.ira-placeno-table thead th.tr { text-align: right; }

.ira-placeno-table tbody td {
  padding: 2px 4px;
  border-bottom: 1px solid #c8d8e4;
}

.ira-placeno-table tbody td.tr { text-align: right; }

.ira-placeno-new-row { background: var(--wh); }

.ira-pl-inp {
  border: none;
  background: transparent;
  font-size: 13px;
  font-family: inherit;
  width: 100%;
  padding: 2px 4px;
  outline: none;
  height: 24px;
  color: var(--tx);
}

.ira-pl-num { text-align: right; font-variant-numeric: tabular-nums; }

/* Plavo gradijentno područje ispod tablice plaćanja */
.ira-placeno-blue {
  background: linear-gradient(180deg, #c8d8f0 0%, #a8c0e8 40%, #8fb0e0 100%);
  height: 80px;
  display: flex;
  align-items: flex-end;
  padding: 6px 8px;
}

.ira-placeno-total-row {
  width: 100%;
  display: flex;
  justify-content: flex-end;
}

.ira-placeno-total-val {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--tx);
}

/* ── Platiti po računu ───────────────────────────────────── */
.ira-platiti-row {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.ira-platiti-val {
  font-size: 13px;
  color: var(--tx);
  font-variant-numeric: tabular-nums;
  display: block;
  padding: 3px 0;
}

.ira-platiti-bold {
  font-weight: 700;
}

