/* Hero */
.arm-hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; margin: 22px 0; }
.arm-hero-text h1 { font-size: 22px; font-weight: 700; margin: 0 0 4px; color: var(--ar-text); }
.arm-hero-text p { color: var(--ar-muted); margin: 0; font-size: 14px; }
.arm-hero-kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* Layout */
.arm-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  height: 600px;
}

/* Side panel */
.arm-side { background: #fff; border: 1px solid var(--ar-border); border-radius: 10px; display: flex; flex-direction: column; overflow: hidden; }
.arm-side-header { padding: 14px 16px; font-weight: 700; font-size: 14px; border-bottom: 1px solid var(--ar-border); }
.arm-filters { padding: 12px 16px; border-bottom: 1px solid var(--ar-border); display: flex; flex-direction: column; gap: 10px; }
.arm-search { position: relative; }
.arm-search i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ar-muted); font-size: 12px; }
.arm-search input { width: 100%; padding: 8px 10px 8px 32px; border: 1px solid var(--ar-border); border-radius: 6px; font-size: 13px; }

#arm-search{
	    padding-left: 32px;
}

.arm-list { flex: 1; overflow-y: auto; padding: 8px; }
.arm-list-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 6px; cursor: pointer; transition: background 0.15s; }
.arm-list-item:hover { background: #f5f7fa; }
.arm-list-item > i:first-child { color: var(--ar-primary); font-size: 16px; }
.arm-list-item-text { flex: 1; min-width: 0; }
.arm-list-item-title { font-weight: 600; font-size: 13px; color: var(--ar-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arm-list-item-sub { font-size: 11px; color: var(--ar-muted); margin-top: 2px; }
.arm-list-item > i:last-child { color: var(--ar-muted); font-size: 11px; }
.arm-empty { padding: 20px; text-align: center; color: var(--ar-muted); font-size: 13px; }

/* Mapa */
.arm-map-wrap { position: relative; min-height: 600px; border-radius: 10px; overflow: hidden; border: 1px solid var(--ar-border); background: #e8eef5; }
#arm-map { width: 100%; height: 100%; min-height: 600px; }
.arm-map-message { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; color: var(--ar-muted); font-size: 14px; text-align: center; background: #f8fafc; z-index: 1; }

/* Leaflet tooltip — lista svih ustanova, agresivno prelamanje */
.leaflet-tooltip,
.leaflet-tooltip-pane .leaflet-tooltip {
  max-width: 240px !important;
  width: max-content !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  hyphens: auto;
  font-size: 12px;
  line-height: 1.35;
  padding: 6px 9px;
}
.arm-tip-name {
  font-weight: 700;
  margin-bottom: 3px;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  max-width: 100%;
}
.arm-tip-name + .arm-tip-name {
  border-top: 1px solid rgba(0,0,0,0.08);
  padding-top: 3px;
}
.arm-tip-count {
  margin-top: 4px;
  font-weight: 500;
  color: #555;
}

@media (max-width: 640px) {
  .leaflet-tooltip,
  .leaflet-tooltip-pane .leaflet-tooltip { max-width: 70vw !important; font-size: 11px; }
}


/* Detalj panel */
.arm-detail { position: fixed; right: 24px; bottom: 48px; width: 360px; max-height: calc(70vh - 24px); overflow-y: auto; background: #fff; border: 1px solid var(--ar-border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); z-index: 1000; }
.arm-detail[hidden] { display: none; }
.arm-detail-header { padding: 14px 16px; border-bottom: 1px solid var(--ar-border); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.arm-detail-title { font-weight: 700; font-size: 15px; color: var(--ar-text); line-height: 1.3; }
.arm-detail-sub { font-size: 12px; color: var(--ar-muted); margin-top: 2px; }
.arm-detail-close { background: transparent; border: 0; cursor: pointer; font-size: 22px; color: var(--ar-muted); padding: 0 4px; line-height: 1; }
.arm-detail-body { padding: 14px 16px; }
.arm-detail-section-title { font-weight: 700; font-size: 13px; color: var(--ar-text); margin: 4px 0 10px; text-transform: uppercase; letter-spacing: 0.3px; }
.arm-detail-note { font-size: 11px; color: var(--ar-muted); margin-bottom: 10px; padding: 6px 10px; background: #fff3cd; border-radius: 4px; }

/* Badge boje — identične kao na stranici pretrage */
.arm-detail .ar-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.arm-detail .ar-badge--green  { background: #dcfce7; color: #166534; }
.arm-detail .ar-badge--orange { background: #ffedd5; color: #9a3412; }
.arm-detail .ar-badge--red    { background: #fee2e2; color: #991b1b; }
.arm-detail .ar-badge--gray   { background: #f1f5f9; color: #475569; }
.arm-detail .ar-badge--blue   { background: #e0e7ff; color: #1e3a8a; }

/* Sekcija ustanove kad na jednoj lokaciji ima vise ustanova */
.arm-inst-group { margin-bottom: 16px; }
.arm-inst-group:last-child { margin-bottom: 0; }
.arm-inst-name { font-weight: 700; font-size: 14px; color: var(--ar-primary); margin-bottom: 2px; }
.arm-inst-meta { font-size: 11px; color: var(--ar-muted); margin-bottom: 10px; }

/* Kartica jednog kliničkog ispitivanja u mapa-panelu */
.arm-trial { background: #f8fafc; border: 1px solid var(--ar-border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.arm-trial:last-child { margin-bottom: 0; }
.arm-trial-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.arm-trial-protocol { font-family: 'SFMono-Regular', Menlo, monospace; font-size: 12px; font-weight: 700; color: var(--ar-primary); }
.arm-trial-title { font-size: 13px; font-weight: 600; color: var(--ar-text); line-height: 1.35; margin-bottom: 6px; }
.arm-trial-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--ar-muted); margin-bottom: 8px; }
.arm-trial-meta b { color: var(--ar-text); }
.arm-trial-disease { width: 100%; }
.arm-trial-link { font-size: 12px; color: var(--ar-primary); font-weight: 600; text-decoration: none; }
.arm-trial-link:hover { text-decoration: underline; }

/* Bottom info */
.arm-footer-info { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; font-size: 12px; color: var(--ar-muted); }
.arm-footer-info i { margin-right: 6px; }

/* Responsive */
@media (max-width: 1100px) {
  .arm-hero { grid-template-columns: 1fr; }
  .arm-hero-kpi { grid-template-columns: repeat(2, 1fr); }
  .arm-layout { grid-template-columns: 1fr; height: auto; }
  .arm-side { max-height: none; }
  .arm-list { display: none; }
  .arm-map-wrap { height: 500px; min-height: 500px; }
  #arm-map { min-height: 500px; }
  .arm-detail { right: 12px; bottom: 48px; width: calc(100% - 24px); max-width: 360px; }
}

@media (max-width: 640px) {
  .arm-hero-kpi { grid-template-columns: 1fr; }
  .arm-hero-text h1 { font-size: 18px; }
  .arm-hero-text p { font-size: 13px; }
  .arm-side { max-height: none; }
}
