:root {
  --ar-primary: #0D4873;
  --ar-primary-dark: #0D4873;
  --ar-bg: #f5f7fa;
  --ar-surface: #fff;
  --ar-border: #e1e6ed;
  --ar-text: #1f2937;
  --ar-muted: #6b7c8c;
  --ar-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* Inter font samo za registar */
.alims-registry,
.alims-registry button,
.alims-registry input,
.alims-registry select,
.ar-detail,
.ar-overlay,
.ar-header-toggle {
  font-family: var(--ar-font);
}

/* Tabular numbers za tabele i KPI */
.ar-table,
.ar-kpi-value,
.ar-pop-line,
.ar-phase-pct,
.ar-pagination {
  font-variant-numeric: tabular-nums;
}

/* Page Title Bar (Avada banner sa naslovom stranice) — sakriven na ovoj stranici */
.page-id-35122 .fusion-page-title-bar,
.page-id-35124 .fusion-page-title-bar {
  display: none !important;
}

/* Avada banner (logo + pretraga + grb) — sakriven na ovoj stranici */
.page-id-35122 .fusion-header,
.page-id-35122 .fusion-header-sticky-height,
.page-id-35124 .fusion-header,
.page-id-35124 .fusion-header-sticky-height {
  display: none !important;
}

.page-id-35122 .fusion-sticky-header-wrapper,
.page-id-35124 .fusion-sticky-header-wrapper {
  height: auto !important;
}

/* Sakrij Secondary Mobile Menu na našim stranicama (ostavi samo glavni) */
.page-id-35122 .fusion-mobile-nav-holder[aria-label="Secondary Mobile Menu"],
.page-id-35124 .fusion-mobile-nav-holder[aria-label="Secondary Mobile Menu"] {
  display: none !important;
}

/* Avada-in default top padding na #main — uklanjamo da subnav prilegne uz meni */
.page-id-35122 #main,
.page-id-35124 #main {
  padding-top: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Forsiraj sve Avada wrapper-e da budu 100% širine, bez min-widtha — bez ovoga Avada drži ~1200px min-width i sajt nije responsive */
.page-id-35122 #wrapper,
.page-id-35124 #wrapper,
.page-id-35122 #boxed-wrapper,
.page-id-35124 #boxed-wrapper,
.page-id-35122 .fusion-wrapper,
.page-id-35124 .fusion-wrapper,
.page-id-35122 #content,
.page-id-35124 #content {
  max-width: 100% !important;
  min-width: 0 !important;
  width: 100% !important;
}

.page-id-35122 #main .fusion-row,
.page-id-35124 #main .fusion-row {
  max-width: none !important;
  width: 100% !important;
  min-width: 0 !important;
  float: none !important;
}

/* Registar-sekcija ne dozvoljava horizontalni prelivni sadržaj van sebe —
   .ar-table-wrap unutra i dalje može da skroluje horizontalno svoju tabelu */
.page-id-35122 .alims-registry,
.page-id-35124 .alims-registry {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

.alims-registry {
  background: var(--ar-bg);
  color: var(--ar-text);
}

.ar-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* HERO TRAKA */
.ar-hero-bar {
  background: #0D4873;
  color: #fff; padding: 36px 0 24px; text-align: center;
}
.ar-hero-bar h1 { font-size: 32px; font-weight: 800; letter-spacing: 0.5px; margin: 0 0 8px; text-transform: uppercase; }
.ar-hero-bar p { margin: 0; opacity: 0.85; font-size: 15px; }

/* INTERNI NAV REGISTRA — full width, prirodno (.alims-registry je već 100%) */
.ar-subnav {
  background: #0D4873;
  color: #fff;
  margin-bottom: 24px;
}
.ar-subnav--contained {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.ar-shortcode-wrap {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.ar-shortcode-wrap .ar-subnav {
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.ar-shortcode-wrap .ar-subnav-inner {
  max-width: none;
}
.ar-shortnav {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #0D4873;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  margin: 0 0 24px;
  overflow: hidden;
}
.ar-shortnav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
  padding: 14px 0;
  flex: 0 1 auto;
  min-width: 0;
}
.ar-shortnav-brand i {
  font-size: 22px;
  color: #93c5fd;
}
.ar-shortnav-tabs {
  list-style: none;
  display: flex;
  gap: 4px;
  padding: 0;
  margin: 0 0 0 auto;
  flex: 0 0 auto;
}
.ar-shortnav-tabs li {
  margin: 0;
}
.ar-shortnav-tabs a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 16px 18px;
  display: block;
  font-size: 14px;
  border-bottom: 3px solid transparent;
}
.ar-shortnav-tabs a:hover {
  color: #fff;
}
.ar-shortnav-tabs .ar-active a {
  color: #fff;
  border-bottom-color: #93c5fd;
  font-weight: 600;
}
.ar-subnav-inner { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; gap: 24px; padding: 0 24px; }
.ar-subnav-brand { display: flex; align-items: center; gap: 10px; font-size: 14px; line-height: 1.2; font-weight: 600; padding: 14px 0; }
.ar-subnav-brand i { font-size: 22px; color: #93c5fd; }
.ar-subnav-tabs { list-style: none; display: flex; gap: 4px; padding: 0; margin: 0 0 0 auto; }
.ar-subnav-tabs li { margin: 0; }
.ar-subnav-tabs a { color: rgba(255,255,255,0.85); text-decoration: none; padding: 16px 18px; display: block; font-size: 14px; border-bottom: 3px solid transparent; transition: color 0.15s, border-color 0.15s; }
.ar-subnav-tabs a:hover { color: #fff; }
.ar-subnav-tabs .ar-active a { color: #fff; border-bottom-color: #93c5fd; font-weight: 600; }

/* KPI */
.ar-kpi { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1.3fr; gap: 14px; margin: 22px 0; }
.ar-kpi-card { background: #fff; border: 1px solid var(--ar-border); border-radius: 10px; padding: 16px; display: flex; align-items: center; gap: 14px; }
.ar-kpi-icon { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: #e0e7ff; color: var(--ar-primary); font-size: 18px; }
.ar-kpi-icon--green  { background: #dcfce7; color: #16a34a; }
.ar-kpi-icon--orange { background: #ffedd5; color: #ea580c; }
.ar-kpi-icon--blue2  { background: #dbeafe; color: #0D4873; }
.ar-kpi-text { min-width: 0; }
.ar-kpi-label { font-size: 12px; color: var(--ar-muted); margin-bottom: 2px; }
.ar-kpi-value { font-size: 24px; font-weight: 800; color: var(--ar-text); line-height: 1; }
.ar-kpi-sub { font-size: 11px; color: var(--ar-muted); margin-top: 4px; }

/* Phase chart */
.ar-kpi-card--chart { align-items: stretch; min-width: 0; }
.ar-kpi-card--chart .ar-kpi-text { width: 100%; min-width: 0; }
.ar-phase-bars { display: flex; gap: 6px; align-items: stretch; margin-top: 4px; }
.ar-phase-item { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.ar-phase-bar { width: 100%; max-width: 24px; height: 30px; display: flex; align-items: flex-end; }
.ar-phase-bar-fill { width: 100%; background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%); border-radius: 3px; min-height: 3px; }
.ar-phase-label { font-size: 10px; color: var(--ar-muted); font-weight: 700; line-height: 1; margin-top: 4px; }
.ar-phase-pct { font-size: 10px; font-weight: 600; color: var(--ar-text); line-height: 1; }

/* FILTERS */
.ar-filters { background: #fff; border: 1px solid var(--ar-border); border-radius: 10px; padding: 14px 16px; margin-bottom: 18px; }
.ar-filter-row { display: grid; grid-template-columns: repeat(6, 1fr) auto; gap: 10px; align-items: end; }
.ar-filter-row.ar-more { grid-template-columns: repeat(3, 1fr); margin-top: 10px; display: none; }
.ar-filter-row.ar-more.ar-show { display: grid; }
.ar-field label { display: block; font-size: 11px; color: var(--ar-muted); margin-bottom: 3px; font-weight: 600; }
.ar-field select, .ar-field input { width: 100%; padding: 7px 10px; border: 1px solid var(--ar-border); border-radius: 6px; background: #fff; font-size: 13px; color: var(--ar-text); }
.ar-filter-actions { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
.ar-btn { padding: 8px 14px; border: none; border-radius: 6px; background: var(--ar-primary); color: #fff; font-weight: 600; cursor: pointer; font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ar-btn:hover { background: var(--ar-primary-dark); color: #fff; }
.ar-btn--ghost { background: transparent; color: var(--ar-text); border: 1px solid var(--ar-border); }
.ar-btn--block { display: block; text-align: center; margin-top: 14px; }
.ar-toggle-more { font-size: 13px; color: var(--ar-text); cursor: pointer; padding: 8px 12px; border: 1px solid var(--ar-border); border-radius: 6px; user-select: none; white-space: nowrap; }
.ar-toggle-more:hover { background: #f0f3f7; }

.ar-chips { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.ar-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: #e0e7ff; color: var(--ar-primary); border-radius: 14px; font-size: 12px; text-decoration: none; }
.ar-chip:hover { background: #c7d2fe; }
.ar-chip span { font-weight: 700; }

/* TABLE */
.ar-table-wrap { background: #fff; border: 1px solid var(--ar-border); border-radius: 10px; overflow-x: auto; }
.ar-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ar-table thead th { background: var(--ar-primary); color: #fff; text-align: left; padding: 12px 12px; font-weight: 600; white-space: nowrap; font-size: 12px; }
.ar-table thead a { color: #fff; text-decoration: none; }
.ar-table thead a:hover { color: #c7d2fe; }
.ar-th-sub { font-size: 10px; opacity: 0.7; font-weight: 400; margin-top: 1px; }
.ar-table tbody tr { cursor: pointer; transition: background 0.1s; border-bottom: 1px solid var(--ar-border); }
.ar-table tbody tr:hover { background: #f8fafc; }
.ar-table tbody tr.ar-selected { background: #eff6ff; }
.ar-table td { padding: 12px 12px; vertical-align: top; }
.ar-col-fav { width: 30px; text-align: center; color: #cbd5e1; }
.ar-col-fav i { cursor: pointer; }
.ar-col-fav i:hover { color: #f59e0b; }
.ar-col-naziv { min-width: 200px; }
.ar-cell-protocol { font-weight: 700; font-size: 13px; color: var(--ar-text); }
.ar-cell-naziv { font-size: 11px; color: var(--ar-muted); margin-top: 2px; }
.ar-cell-sub { font-size: 11px; color: var(--ar-muted); margin-top: 2px; }
.ar-faza-pill { display: inline-block; padding: 3px 10px; background: #e0e7ff; color: var(--ar-primary); border-radius: 4px; font-weight: 600; font-size: 12px; margin-right: 4px; margin-bottom: 2px; }
.ar-faza-pill:last-child { margin-right: 0; }
.ar-pop-line { font-weight: 600; font-size: 13px; }
.ar-pop-bar { background: #e5e7eb; height: 4px; border-radius: 2px; margin-top: 4px; overflow: hidden; }
.ar-pop-bar-fill { background: linear-gradient(90deg, #4ade80, #16a34a); height: 100%; }

.ar-empty { padding: 40px; text-align: center; color: var(--ar-muted); }

/* BADGE */
.ar-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.ar-badge--green  { background: #dcfce7; color: #166534; }
.ar-badge--orange { background: #ffedd5; color: #9a3412; }
.ar-badge--red    { background: #fee2e2; color: #991b1b; }
.ar-badge--gray   { background: #f1f5f9; color: #475569; }
.ar-badge--blue   { background: #e0e7ff; color: var(--ar-primary); }

/* LEKOVI / USTANOVE — strukturisan prikaz */
.ar-lek { background: #f8fafc; border: 1px solid var(--ar-border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.ar-lek.ar-ust { background: #f0f7ff; border-color: #dbeafe; }
.ar-lek:last-child { margin-bottom: 0; }
.ar-lek-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ar-lek-name { font-weight: 700; color: var(--ar-text); font-size: 14px; }
.ar-lek-role { font-size: 11px; color: var(--ar-primary); background: #e0e7ff; padding: 2px 8px; border-radius: 4px; }
.ar-lek-meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 12px; margin: 0; }
.ar-lek-meta dt { color: var(--ar-muted); font-weight: 600; }
.ar-lek-meta dd { margin: 0; color: var(--ar-text); }

/* PAGINATION */
.ar-pagination { display: flex; justify-content: flex-end; gap: 4px; margin-top: 16px; align-items: center; flex-wrap: wrap; }
.ar-pag-info { margin-right: auto; color: var(--ar-muted); font-size: 12px; }
.ar-pagination a, .ar-pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 10px; border: 1px solid var(--ar-border); border-radius: 6px; text-decoration: none; color: var(--ar-text); background: #fff; font-size: 13px; }
.ar-pagination a:hover { background: #f0f3f7; }
.ar-pagination .ar-current { background: var(--ar-primary); color: #fff; border-color: var(--ar-primary); }
.ar-pagination .ar-disabled { color: #c0c8d0; cursor: default; }
.ar-pag-info { border: none; padding: 0; background: none; min-width: 0; height: auto; }

/* PILLARS */
.ar-pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 30px 0; }
.ar-pillar { display: flex; gap: 12px; align-items: center; padding: 14px; }
.ar-pillar-icon { width: 40px; height: 40px; background: #e0e7ff; color: var(--ar-primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ar-pillar-title { font-weight: 700; color: var(--ar-text); }
.ar-pillar-sub { font-size: 12px; color: var(--ar-muted); margin-top: 2px; }

/* DETAIL PANEL */
.ar-overlay { position: fixed; inset: 0; background: rgba(20,30,50,0.4); z-index: 99998; opacity: 0; visibility: hidden; transition: opacity 0.25s; }
.ar-detail { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: #fff; border-left: 1px solid var(--ar-border); z-index: 99999; overflow-y: auto; transform: translateX(100%); transition: transform 0.25s ease; box-shadow: -4px 0 20px rgba(0,0,0,0.08); }
body.admin-bar .ar-detail { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar .ar-detail { top: 46px; }
}
body.ar-detail-open .ar-detail { transform: translateX(0); }
body.ar-detail-open .ar-overlay { opacity: 1; visibility: visible; }
.ar-detail-header { padding: 16px 20px 12px; border-bottom: 1px solid var(--ar-border); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; position: sticky; top: 0; background: #fff; z-index: 1; }
.ar-detail-header-main { flex: 1; min-width: 0; }
.ar-detail-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ar-detail-protocol { font-size: 13px; font-weight: 700; color: var(--ar-primary); font-family: 'SFMono-Regular', Menlo, monospace; letter-spacing: 0.3px; }
.ar-detail-title { font-size: 15px; font-weight: 700; color: var(--ar-text); margin: 0; line-height: 1.35; }
.ar-detail-close { background: transparent; border: 0; font-size: 24px; cursor: pointer; color: var(--ar-muted); padding: 0 4px; line-height: 1; }
.ar-detail-close:hover { color: var(--ar-text); }
.ar-detail-body { padding: 24px 20px 40px; }
.ar-detail-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.ar-detail-row:last-of-type { border-bottom: 0; }
.ar-detail-row > i { width: 18px; color: var(--ar-muted); margin-top: 3px; flex-shrink: 0; }
.ar-detail-row-label { font-size: 11px; color: var(--ar-muted); margin-bottom: 2px; }
.ar-detail-row-value { font-size: 13px; color: var(--ar-text); line-height: 1.4; }

/* RESPONSIVE — postupno razlaganje */

/* Tabela ima minimalnu širinu da se zadrži čitljiv layout — horizontalni skrol na manjim ekranima */
.ar-table { min-width: 900px; }

/* Laptop / mali desktop — KPI ostaje 5 kartica u jednom redu */
@media (max-width: 1280px) {
  .ar-filter-row { grid-template-columns: repeat(3, 1fr); }
  .ar-filter-actions { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; }
}

/* Tablet horizontalno — 2x2 KPI + chart ispod */
@media (max-width: 1024px) {
  .ar-subnav-tabs { gap: 0; }
  .ar-subnav-tabs a { padding: 14px 10px; font-size: 13px; }
  .ar-kpi { grid-template-columns: 1fr 1fr; }
  .ar-kpi-card--chart { grid-column: 1 / -1; }
  /* Pillars ostaju 3-col na tabletu */
}

/* Tablet portrait / mali tablet (768px se desktop OS-ovi prebacuju) */
@media (max-width: 820px) {
  .ar-filter-row { grid-template-columns: repeat(2, 1fr); }
  .ar-pillars { grid-template-columns: repeat(2, 1fr); }

  /* Subnav: skraćujemo brand na ikonu, tabovi zauzimaju ostatak širine */
  .ar-subnav-inner { gap: 8px; padding: 0 12px; }
  .ar-subnav-brand { flex-shrink: 0; padding: 12px 0; }
  .ar-subnav-brand span { display: none; }
  .ar-subnav-tabs { flex: 1; margin-left: 0; flex-wrap: nowrap; justify-content: flex-end; }
  .ar-subnav-tabs a { padding: 14px 14px; white-space: nowrap; font-size: 13px; }

  .ar-detail { width: 100vw; max-width: 100vw; }
}

/* Mali tablet / veliki telefon */
@media (max-width: 600px) {
  .ar-kpi { grid-template-columns: 1fr; }
  .ar-kpi-card { padding: 12px 14px; }
  .ar-kpi-value { font-size: 20px; }
  .ar-pillars { grid-template-columns: 1fr; }

  /* Subnav vertikalno na pravom mobilu */
  .ar-subnav-inner { flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 16px; }
  .ar-subnav-brand { padding: 6px 0; }
  .ar-subnav-tabs { width: 100%; }

  .ar-filter-row { grid-template-columns: 1fr; }
  .ar-filter-actions { gap: 6px; }
  .ar-filter-actions .ar-btn { flex: 1; justify-content: center; }
  .ar-toggle-more { width: 100%; text-align: center; }

  /* Tabela na mobilu — prikaz po karticama, nije horizontalni skrol */
  .ar-table-wrap { overflow-x: visible; }
  .ar-table { min-width: 0; }
  .ar-table thead { display: none; }
  .ar-table, .ar-table tbody, .ar-table tr, .ar-table td { display: block; width: 100%; }
  .ar-table tr { border-bottom: 1px solid var(--ar-border); padding: 12px 14px; }
  .ar-table tr:last-child { border-bottom: 0; }
  .ar-table td { padding: 4px 0; border: 0; }
  .ar-table td.ar-col-naziv { padding-bottom: 8px; }
  .ar-table .ar-cell-protocol { font-size: 12px; color: var(--ar-muted); }
  .ar-table .ar-naziv-text { -webkit-line-clamp: 3; }

  .ar-pagination { font-size: 12px; }
  .ar-pag-info { width: 100%; text-align: center; margin-bottom: 6px; }
}
