/* ======================================================
   RKP REGISTAR - JAVNI PRIKAZ
   ====================================================== */

.rkp-wrap {
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #1e1e1e;
}

/* ======================================================
   NASLOV
   ====================================================== */
.rkp-main-title {
  font-size: 24px;
  font-weight: 700;
  color: #1e1e1e;
  margin: 0 0 24px 0;
  padding: 0;
  line-height: 1.3;
  text-align: center;
}

@media (max-width: 768px) {
  .rkp-main-title {
    font-size: 20px;
    margin: 0 0 20px 0;
  }
}

/* ======================================================
   FILTERI / KONTROLE
   ====================================================== */
.rkp-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin: 0 0 16px 0;
}

.rkp-control label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 13px;
  color: #333;
}

.rkp-control select,
.rkp-control input {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid #cfd3d7;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  color: #1e1e1e;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

/* Select opcije - tekst prelom */
.rkp-control select option {
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.rkp-control select:focus,
.rkp-control input:focus {
  outline: none;
  border-color: #2271b1;
  box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}

.rkp-control.rkp-reset {
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
}

/* Reset + Analitika dugmad u istom redu (DESKTOP) */
.rkp-control.rkp-buttons-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

/* DESKTOP: Sakriveni mobilni elementi */
.rkp-action-buttons,
.rkp-analytics-row {
  display: none;
}

/* Search wrapper - input + dugme */
.rkp-search-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

.rkp-search-wrapper #rkp-search {
  flex: 1;
  min-width: 0;
}

.rkp-btn-search {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 10px 20px;
}

/* ======================================================
   CUSTOM DROPDOWN (za institucije i funkcije)
   ====================================================== */
.rkp-dropdown {
  position: relative;
  width: 100%;
}

.rkp-dropdown-toggle {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border: 1px solid #cfd3d7;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  color: #1e1e1e;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  min-height: 42px;
}

.rkp-dropdown-toggle:hover {
  border-color: #2271b1;
}

.rkp-dropdown-toggle:focus {
  outline: none;
  border-color: #2271b1;
  box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}

.rkp-dropdown-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rkp-dropdown-arrow {
  position: absolute;
  right: 12px;
  font-size: 10px;
  color: #666;
  transition: transform 0.2s ease;
}

.rkp-dropdown.open .rkp-dropdown-arrow {
  transform: rotate(180deg);
}

.rkp-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  border: 1px solid #cfd3d7;
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.rkp-dropdown.open .rkp-dropdown-menu {
  display: block;
}

/* v0.9.31: SEARCH BOX u dropdown-u */
.rkp-dropdown-search {
  padding: 8px;
  border-bottom: 2px solid #e0e0e0;
  background: #f8f9fa;
  position: sticky;
  top: 0;
  z-index: 10;
}

.rkp-dropdown-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cfd3d7;
  border-radius: 4px;
  font-size: 14px;
  color: #1e1e1e;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rkp-dropdown-search-input:focus {
  outline: none;
  border-color: #2271b1;
  box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}

.rkp-dropdown-search-input::placeholder {
  color: #999;
  font-style: italic;
}

/* Container za opcije - scrollable */
.rkp-dropdown-options {
  max-height: 260px;
  overflow-y: auto;
}

.rkp-dropdown-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  color: #1e1e1e;
  /* KLJUČNO: omogući prelom teksta */
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.4;
}

.rkp-dropdown-item:last-child {
  border-bottom: none;
}

.rkp-dropdown-item:hover {
  background: #f0f6ff;
}

.rkp-dropdown-item.selected {
  background: #e6f0ff;
  font-weight: 600;
}

.rkp-dropdown-item.rkp-highlighted {
  background: #d0e8ff;
  border-left: 3px solid #2271b1;
}

.rkp-dropdown-item.rkp-dd-placeholder {
  color: #666;
  font-style: italic;
}

/* ======================================================
   DUGMAD
   ====================================================== */
.rkp-btn {
  padding: 10px 18px;
  border: 1px solid #2271b1;
  background: #2271b1;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s ease, transform 0.1s ease;
}

.rkp-btn:hover {
  background: #135e96;
  border-color: #135e96;
  color: #fff;
}

.rkp-btn:active {
  transform: translateY(1px);
}

/* ======================================================
   INFORMATIVNA PORUKA
   ====================================================== */
.rkp-info-notice {
  background: #eaf3fb;
  border: 1px solid #b6d4ec;
  border-left: 4px solid #2271b1;
  border-radius: 6px;
  padding: 14px 18px;
  margin: 0 0 18px;
  color: #1d3a52;
  font-size: 14px;
  line-height: 1.5;
}

/* ======================================================
   TABELA WRAP
   ====================================================== */
.rkp-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* ======================================================
   TABELA (DESKTOP)
   ====================================================== */
.rkp-table {
  width: 100%;
  border-collapse: collapse;
  /* min-width uklonjeno - tabela se prilagođava širini ekrana */
  table-layout: fixed;
}

/* Širine kolona (desktop) — institucija šira, ostale sužene, Info najuži (kao na drugom registru) */
.rkp-col-institucija { width: 33%; }
.rkp-col-korisnik    { width: 18%; }
.rkp-col-opcina      { width: 12%; }
.rkp-col-vrsta       { width: 18%; }
.rkp-col-iznos       { width: 13%; }
.rkp-col-info        { width: 6%;  }

.rkp-table th,
.rkp-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
}

.rkp-table thead th {
  position: sticky;
  top: 0;
  background: #2271b1;
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  z-index: 1;
  border-bottom: 2px solid #185a92;
}

/* HOVER HIGHLIGHT */
.rkp-table tbody tr:hover td {
  background: #f0f6ff;
}

/* Hover za sticky Info kolonu - mora imati istu boju */
.rkp-table tbody tr:hover td:nth-child(10) {
  background: #f0f6ff; /* Ista boja kao hover na ostalim kolonama */
}

.rkp-loading {
  text-align: center;
  padding: 24px;
  color: #666;
  font-style: italic;
}

/* ======================================================
   ŠIRINE KOLONA (DESKTOP) - Optimizovano za prilagodljiv prikaz
   ====================================================== */
/* Kolone će se automatski prilagoditi dostupnom prostoru */

.rkp-table th:nth-child(1),
.rkp-table td:nth-child(1) {
  width: 7%; /* Ime - kraće */
}

.rkp-table th:nth-child(2),
.rkp-table td:nth-child(2) {
  width: 9%; /* Prezime */
}

.rkp-table th:nth-child(3),
.rkp-table td:nth-child(3) {
  width: 13%; /* Funkcija imenovanja */
}

.rkp-table th:nth-child(4),
.rkp-table td:nth-child(4) {
  width: 18%; /* Naziv institucije - najšira */
}

.rkp-table th:nth-child(5),
.rkp-table td:nth-child(5) {
  width: 10%; /* Sjedište institucije */
}

.rkp-table th:nth-child(6) {
  width: 9%;
  text-align: center;
}

.rkp-table td:nth-child(6) {
  width: 9%; /* Iznos naknade */
  text-align: right;
  white-space: nowrap;
}

.rkp-table th:nth-child(7),
.rkp-table td:nth-child(7) {
  width: 12%; /* Institucija zaposlenja */
}

.rkp-table th:nth-child(8),
.rkp-table td:nth-child(8) {
  width: 10%; /* Naziv radnog mjesta */
}

.rkp-table th:nth-child(9),
.rkp-table td:nth-child(9) {
  width: 10%; /* Stručna sprema */
}

.rkp-table th:nth-child(10),
.rkp-table td:nth-child(10) {
  width: 60px;
  position: sticky;
  right: 0;
  background: #fff; /* Pozadina da pokrije kolone ispod */
  box-shadow: -2px 0 4px rgba(0,0,0,0.05); /* Sjenka za vizualni efekt */
  z-index: 2;
  text-align: center; /* Horizontalno centriranje */
  vertical-align: middle; /* Vertikalno centriranje */
  padding: 12px 10px; /* Isti padding kao ostale ćelije */
}

/* Sticky header za Info kolonu - posebna pozadina */
.rkp-table thead th:nth-child(10) {
  background: #2271b1;
  z-index: 3; /* Iznad ostalih sticky elemenata */
}

/* ======================================================
   INFO DUGME - SIMPLIFICIRANO
   ====================================================== */
.rkp-info-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid #2271b1;
  background: #2271b1;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  line-height: 22px;
  text-align: center;
  display: inline-block;
  padding: 0;
  /* BEZ hover efekta! */
}

/* Centriranje ikone u Info koloni — nadjačava temu sajta (desktop) */
.rkp-table td.rkp-info-col {
  text-align: center !important;
  vertical-align: middle !important;
}
.rkp-table td.rkp-info-col .rkp-info-btn {
  display: inline-block !important;
  float: none !important;
  margin: 0 auto !important;
}

/* ======================================================
   SORT IKONE
   ====================================================== */
.rkp-sort {
  cursor: pointer;
  user-select: none;
  position: relative;
}

.rkp-sort::before {
  content: "⇅";
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  margin-right: 4px;
}

.rkp-sort.asc::before,
.rkp-sort.desc::before {
  color: #fff;
}

.rkp-sort.asc::after {
  content: " ▲";
  font-size: 10px;
  color: #fff;
}

.rkp-sort.desc::after {
  content: " ▼";
  font-size: 10px;
  color: #fff;
}

/* ======================================================
   FOOTER / PAGINACIJA
   ====================================================== */
.rkp-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  gap: 12px;
}

.rkp-meta {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  color: #555;
  font-size: 13px;
}

.rkp-pagination {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.rkp-page {
  border: 1px solid #2271b1;
  background: #2271b1;
  color: #fff !important;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.rkp-page:hover,
.rkp-page:focus {
  background: #1f6fb2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  transform: translateY(-1px);
  outline: none !important;
}

.rkp-page.active {
  background: #0a4b78;
  border-color: #0a4b78;
}

.rkp-page.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Kill theme focus outlines */
.rkp-page:focus,
.rkp-page:focus-visible,
.rkp-pagination a:focus,
.rkp-pagination a:focus-visible,
.rkp-pagination span:focus,
.rkp-pagination span:focus-visible,
.rkp-pagination :where(a, span):focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/* ======================================================
   MOBILNI LABELS (sakriveni na desktopu)
   ====================================================== */
.rkp-m-label {
  display: none;
}

.rkp-m-val {
  display: inline;
}

/* ======================================================
   RESPONSIVE - TABLET (max 1024px)
   ====================================================== */
@media (max-width: 1024px) {
  .rkp-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  
  .rkp-control.rkp-reset {
    grid-column: span 1;
  }
}

/* ======================================================
   RESPONSIVE - MOBILNI (max 768px) - CARD LAYOUT
   ====================================================== */
@media (max-width: 768px) {
  /* FIX: SVE u JEDNOJ KOLONI - vertikalno */
  .rkp-controls {
    grid-template-columns: 1fr; /* Jedna kolona */
    gap: 12px;
    position: relative;
  }

  /* Custom dropdown na mobilnom */
  .rkp-dropdown-menu {
    max-height: 200px;
    overflow-y: auto;
  }
  
  .rkp-dropdown-options {
    max-height: 150px;
    overflow-y: auto;
  }
  
  /* FIX: Dropdown z-index - ne prelazi preko dugmadi */
  .rkp-dropdown {
    z-index: 100;
  }
  
  .rkp-dropdown.open {
    z-index: 1001;
  }

  .rkp-dropdown-item {
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.5;
  }

  /* Svaki kontrolni element puna širina */
  .rkp-control {
    grid-column: span 1 !important;
  }
  
  /* Pretraga input PUNA ŠIRINA */
  .rkp-control.rkp-search {
    grid-column: span 1;
  }
  
  /* Sakrij desktop "Pretraži" dugme u wrapper-u */
  .rkp-search-wrapper .rkp-btn-search {
    display: none;
  }
  
  /* MOBILNI: Sakrij desktop buttons-row */
  .rkp-control.rkp-buttons-row {
    display: none !important;
  }
  
  /* MOBILNI: Prikaži action buttons (Pretraži + Poništi) */
  .rkp-action-buttons {
    display: grid !important;
    grid-template-columns: 1fr 1fr; /* 2 kolone */
    gap: 8px;
    margin-top: 0;
  }
  
  .rkp-action-buttons .rkp-btn {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
  }
  
  /* MOBILNI: Prikaži Analitika dugme */
  .rkp-analytics-row {
    display: block !important;
  }
  
  .rkp-analytics-row .rkp-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
  }

  .rkp-meta {
    justify-content: center;
    text-align: center;
  }

  /* Tabela postaje card layout */
  .rkp-table {
    min-width: 0;
    table-layout: auto;
  }

  /* Poništi širine kolona na mobilnom (card layout) */
  .rkp-col-institucija,
  .rkp-col-korisnik,
  .rkp-col-opcina,
  .rkp-col-vrsta,
  .rkp-col-iznos,
  .rkp-col-info { width: auto; }

  /* Sakrij header */
  .rkp-table thead {
    display: none;
  }

  /* Red postaje kartica */
  .rkp-table tbody tr {
    display: block;
    margin: 12px 0;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  }
  
  .rkp-table tbody tr:first-child {
    margin-top: 0;
  }

  /* Ćelije kao label:value parovi */
  .rkp-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f1f1;
    text-align: left;
    white-space: normal;
    width: auto !important;
  }

  .rkp-table tbody td:last-child {
    border-bottom: none;
  }

  /* Label/value styling */
  .rkp-m-label {
    display: block;
    flex-shrink: 0;
    min-width: 40%;
    max-width: 45%;
    font-weight: 600;
    color: #555;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: left !important;
  }

  .rkp-m-val {
    display: block;
    flex: 1;
    text-align: left;
    color: #1e1e1e;
    word-break: break-word;
  }

  /* Iznos - samo bold, bez desnog poravnanja */
  .rkp-table tbody td.rkp-right .rkp-m-label {
    text-align: left !important;
  }

  .rkp-table tbody td.rkp-right .rkp-m-val {
    text-align: left;
    font-weight: 600;
    color: #0a6f0a;
  }

  /* Info kolona */
  .rkp-info-col {
    text-align: left;
    background: #f8f9fa;
    padding: 12px 16px !important;
  }
  
  .rkp-info-col .rkp-m-label {
    display: none;
  }
  
  .rkp-info-col .rkp-m-val {
    text-align: center;
    width: 100%;
  }
  
  .rkp-info-col .rkp-info-btn {
    width: 100%;
    height: 40px;
    font-size: 14px;
  }
}

/* ======================================================
   RESPONSIVE - MALI MOBITELI (max 480px)
   ====================================================== */
@media (max-width: 480px) {
  .rkp-controls {
    grid-template-columns: 1fr;
  }

  .rkp-control.rkp-search,
  .rkp-control.rkp-reset {
    grid-column: span 1;
  }

  .rkp-table tbody td {
    padding: 10px 14px;
    flex-direction: column;
    gap: 4px;
  }

  .rkp-m-label {
    min-width: 100%;
    max-width: 100%;
    margin-bottom: 2px;
    text-align: left !important;
  }

  .rkp-m-val {
    text-align: left !important;
    width: 100%;
  }

  .rkp-table tbody td.rkp-right .rkp-m-label {
    text-align: left !important;
  }

  .rkp-table tbody td.rkp-right .rkp-m-val {
    text-align: left !important;
  }
}

/* ======================================================
   MODAL
   ====================================================== */
.rkp-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.rkp-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.rkp-modal-dialog {
  position: relative;
  width: 900px;
  max-width: 100%;
  margin: 20px auto;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.rkp-modal-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
}

.rkp-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1e1e1e;
}

.rkp-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.rkp-modal-close:hover {
  background: #e5e5e5;
  color: #333;
}

.rkp-modal-body {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
}

.rkp-modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  background: #f8f9fa;
}

/* ======================================================
   MODAL - DETALJI
   ====================================================== */
.rkp-details {
  display: grid;
  gap: 8px;
}

.rkp-detail-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  background: #fafafa;
}

.rkp-detail-key {
  font-weight: 600;
  color: #333;
  font-size: 13px;
}

.rkp-detail-val {
  word-break: break-word;
  color: #1e1e1e;
}

/* MODAL RESPONSIVE */
@media (max-width: 768px) {
  .rkp-modal {
    padding: 10px;
  }
  
  .rkp-modal-dialog {
    margin: 10px auto;
    border-radius: 10px;
  }
  
  .rkp-modal-header {
    padding: 14px 16px;
  }
  
  .rkp-modal-header h3 {
    font-size: 16px;
  }
  
  .rkp-modal-body {
    padding: 16px;
    max-height: 60vh;
  }
  
  .rkp-detail-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px 12px;
  }
  
  .rkp-detail-key {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #666;
  }
}

@media (max-width: 480px) {
  .rkp-modal-body {
    max-height: 55vh;
  }
  
  .rkp-modal-footer {
    padding: 12px 16px;
  }
  
  .rkp-modal-footer .rkp-btn {
    width: 100%;
  }
}

/* ======================================================
   PRINT STYLES
   ====================================================== */
@media print {
  .rkp-controls,
  .rkp-pagination,
  .rkp-info-col,
  .rkp-modal {
    display: none !important;
  }
  
  .rkp-table-wrap {
    overflow: visible;
    border: none;
    box-shadow: none;
  }
  
  .rkp-table {
    min-width: 0;
  }
  
  .rkp-table th,
  .rkp-table td {
    border: 1px solid #ccc;
    padding: 8px;
  }
}

/* ======================================================
   ANALITIKA DUGME I MODAL
   ====================================================== */

.rkp-btn-analytics {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rkp-btn-analytics:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
  color: #fff;
}

.rkp-analytics-btn {
  display: flex;
  align-items: flex-end;
}

/* Analitika modal - veći */
.rkp-analytics-modal .rkp-modal-dialog.rkp-modal-xl {
  max-width: 95%;
  width: 1400px;
  max-height: 95vh;
}

.rkp-analytics-modal .rkp-modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(95vh - 140px);
}

.rkp-analytics-modal .rkp-modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.rkp-analytics-modal .rkp-modal-header h3 {
  color: #fff;
}

.rkp-analytics-modal .rkp-modal-close {
  color: #fff;
}

.rkp-analytics-modal .rkp-modal-close:hover {
  background: rgba(255,255,255,0.2);
}

/* Loading spinner */
.rkp-analytics-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #666;
}

.rkp-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #e0e0e0;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: rkp-spin 1s linear infinite;
}

@keyframes rkp-spin {
  to { transform: rotate(360deg); }
}

/* Analitika summary kartice */
.rkp-analytics-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 30px;
}

.rkp-summary-card {
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.rkp-summary-card.rkp-card-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.rkp-summary-card.rkp-card-success {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: #fff;
}

.rkp-summary-card.rkp-card-warning {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: #fff;
}

.rkp-summary-card.rkp-card-info {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: #fff;
}

.rkp-summary-number {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
}

.rkp-summary-label {
  font-size: 13px;
  margin-top: 6px;
  opacity: 0.9;
}

/* Grafikon grid */
.rkp-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 40px; /* Povećan razmak između redova */
}

.rkp-chart-box {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.rkp-chart-box h4 {
  margin: 0 0 16px 0;
  font-size: 15px;
  font-weight: 600;
  color: #333;
  padding-bottom: 10px;
  border-bottom: 2px solid #667eea;
}

.rkp-chart-container {
  position: relative;
  height: 280px;
}

/* Za PIE grafikone manji */
.rkp-chart-box.rkp-pie-chart .rkp-chart-container {
  height: 240px;
}

/* Fullwidth grafikon (suma naknada po institucijama) */
.rkp-chart-box.rkp-chart-fullwidth {
  margin: 24px 0;
}

.rkp-chart-container.rkp-chart-tall {
  height: 700px;
}

/* Institucije: donut + lista */
.rkp-inst-wrap {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}
.rkp-inst-donut {
  position: relative;
  width: 100%;
  height: 320px;
}
.rkp-inst-list {
  font-size: 13px;
  max-height: 360px;
  overflow-y: auto;
}
.rkp-inst-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.rkp-inst-row.rkp-inst-head {
  font-weight: 600;
  color: #555;
  border-bottom: 1px solid rgba(0,0,0,0.12);
}
.rkp-inst-row.rkp-inst-head span:last-child { text-align: right; }
.rkp-inst-name {
  flex: 1;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.rkp-inst-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-top: 4px;
  flex-shrink: 0;
}
.rkp-inst-val {
  text-align: right;
  white-space: nowrap;
  line-height: 1.4;
}
.rkp-inst-pct {
  color: #777;
  font-size: 12px;
}
.rkp-inst-row.rkp-inst-total {
  font-weight: 600;
  border-bottom: none;
  margin-top: 4px;
  padding-top: 9px;
}
.rkp-inst-row.rkp-inst-total span:last-child { margin-left: auto; }

@media (max-width: 900px) {
  .rkp-inst-wrap { grid-template-columns: 1fr; }
  .rkp-inst-donut { height: 260px; }
  .rkp-inst-list { max-height: none; }
}

/* Responsive za analitiku */
@media (max-width: 1200px) {
  .rkp-charts-grid {
    grid-template-columns: 1fr;
  }
  
  .rkp-analytics-summary {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .rkp-chart-container.rkp-chart-tall {
    height: 600px;
  }
}

@media (max-width: 600px) {
  .rkp-analytics-summary {
    grid-template-columns: 1fr;
  }
  
  .rkp-analytics-modal .rkp-modal-dialog.rkp-modal-xl {
    width: 98%;
    max-width: 98%;
  }
}
