/* Popup styles */
.popup { 
  font-family: inherit; 
  min-width: 280px; 
  max-width: 360px; 
  background: #111827; 
  color: #f9fafb; 
  padding: 10px 12px; 
  border-radius: 10px; 
  border: 1px solid #1f2937; 
  box-shadow: 0 10px 32px rgba(0,0,0,0.35); 
  font-size: 12px; 
  line-height: 1.45; 
}

.popup h3 { 
  margin: 0 0 6px 0; 
  font-size: 13px; 
  color: #ffffff; 
  font-weight: 600; 
}

.popup .search-controls { 
  margin: 6px 0; 
  display: grid;
  grid-template-columns: 1fr auto auto auto; 
  gap: 6px; 
}

.popup .filter-controls { 
  display: grid; 
  grid-template-columns: 1fr auto auto auto; 
  gap: 6px; 
  margin: 6px 0; 
}

.popup input[type="text"] { 
  width: 100%; 
  padding: 6px 8px; 
  font-size: 12px; 
  background: #0b1220; 
  color: #e5e7eb; 
  border: 1px solid #374151; 
  border-radius: 6px; 
}

.popup .list { 
  max-height: 200px; 
  overflow-y: auto; 
  display: grid; 
  gap: 4px; 
  scroll-behavior: smooth;
}

.popup .item { 
  font-size: 12px; 
  line-height: 1.25; 
  padding: 4px 6px; 
  border: 1px solid #374151; 
  border-radius: 6px; 
  background: #0b1220; 
  color: #e5e7eb; 
}

.popup .item .meta { 
  color: #9ca3af; 
  font-size: 11px; 
}

.popup .detail { 
  margin-top: 6px; 
  padding: 6px; 
  background: #0f172a; 
  border: 1px solid #1f2937; 
  border-radius: 6px; 
  font-size: 11px; 
  max-height: 160px; 
  overflow: auto; 
  color: #e5e7eb; 
}

.popup .preview-panel { 
  margin-top: 8px; 
  padding: 8px; 
  background: #0f172a; 
  border: 1px solid #1f2937; 
  border-radius: 6px; 
  font-size: 11px; 
  color: #e5e7eb; 
  display: none;
}

.popup .preview-panel.show { 
  display: block; 
}

.popup .preview-title { 
  font-weight: 600; 
  color: #ffffff; 
  margin-bottom: 4px; 
  font-size: 12px; 
}

.popup .preview-meta { 
  color: #9ca3af; 
  margin-bottom: 6px; 
  font-size: 10px; 
}

.popup .preview-description { 
  margin-bottom: 8px; 
  line-height: 1.4; 
}

.popup .preview-connections { 
  margin-bottom: 8px; 
  color: #60a5fa; 
  font-size: 10px; 
}

.popup .preview-actions { 
  display: flex; 
  gap: 6px; 
  margin-top: 8px; 
}

.popup .preview-actions .btn {
  padding: 4px 8px;
  font-size: 11px;
  flex: 1;
}

.popup .item.selected {
  background: #1f2937;
  border-color: #60a5fa;
}

/* Expanded details styles */
.popup .preview-panel.expanded {
  max-height: 80vh;
  overflow-y: auto;
  padding: 12px;
}

.popup .expanded-header {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #374151;
}

.popup .expanded-title {
  font-weight: 600;
  color: #ffffff;
  font-size: 14px;
  margin-bottom: 4px;
}

.popup .expanded-meta {
  color: #9ca3af;
  font-size: 11px;
  margin-bottom: 8px;
}

.popup .expanded-section {
  margin-bottom: 16px;
}

.popup .expanded-section-title {
  font-weight: 600;
  color: #60a5fa;
  font-size: 12px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.popup .expanded-description {
  color: #e5e7eb;
  font-size: 11px;
  line-height: 1.4;
  background: #0f172a;
  padding: 8px;
  border-radius: 6px;
  border-left: 3px solid #60a5fa;
}

.popup .expanded-notes {
  color: #fbbf24;
  font-size: 11px;
  line-height: 1.4;
  background: #1f2937;
  padding: 8px;
  border-radius: 6px;
  border-left: 3px solid #fbbf24;
}

.popup .expanded-properties {
  display: grid;
  gap: 4px;
}

.popup .property-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 4px 6px;
  background: #1f2937;
  border-radius: 4px;
  font-size: 10px;
}

.popup .property-key {
  color: #9ca3af;
  font-weight: 500;
  min-width: 80px;
  margin-right: 8px;
}

.popup .property-value {
  color: #e5e7eb;
  text-align: right;
  word-break: break-word;
}

.popup .expanded-connections {
  max-height: 200px;
  overflow-y: auto;
  display: grid;
  gap: 3px;
}

.popup .connection-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 6px;
  background: #1f2937;
  border-radius: 4px;
  font-size: 10px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  flex-wrap: wrap;
}

.popup .connection-name {
  color: #e5e7eb;
  font-weight: 500;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  flex: 1;
  min-width: 0;
}

.popup .connection-meta {
  color: #9ca3af;
  font-size: 9px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  flex: 1;
  min-width: 0;
  text-align: right;
}

.popup .connection-more {
  text-align: center;
  color: #9ca3af;
  font-size: 10px;
  font-style: italic;
  padding: 4px;
}

/* Loading and pagination styles */
.popup .loading, .popup .error, .popup .no-results {
  text-align: center;
  padding: 20px;
  color: #9ca3af;
  font-style: italic;
}

.popup .error {
  color: #ef4444;
}

.popup .load-more-btn {
  text-align: center;
  padding: 12px;
  margin: 8px 0;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.popup .load-more-btn:hover {
  background: #374151;
  border-color: #60a5fa;
}

.popup .load-more-text {
  color: #60a5fa;
  font-weight: 500;
  font-size: 12px;
}

.popup .loading-more {
  text-align: center;
  padding: 8px;
  color: #9ca3af;
  font-size: 11px;
  font-style: italic;
}

.popup .expanded-actions {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #374151;
}

.popup .btn-small {
  padding: 3px 6px;
  font-size: 10px;
  margin-bottom: 8px;
}

/* Modern tooltip styles */
.tooltip { 
  background: #111827; 
  color: #f9fafb; 
  padding: 10px 12px; 
  border-radius: 10px; 
  border: 1px solid #1f2937; 
  box-shadow: 0 10px 32px rgba(0,0,0,0.35); 
  min-width: 220px; 
  max-width: 400px; 
  font-size: 12px; 
  line-height: 1.45; 
}

.tooltip-title { 
  margin: 0 0 4px; 
  font-weight: 600; 
  font-size: 13px; 
  color: #ffffff; 
}

.tooltip-meta { 
  margin: 2px 0 0; 
  color: #9ca3af; 
  font-size: 11px; 
}

.tooltip-description { 
  margin: 6px 0 0; 
  color: #e5e7eb; 
  font-size: 11px; 
  line-height: 1.4; 
  background: #0f172a; 
  padding: 6px 8px; 
  border-radius: 6px; 
  border-left: 3px solid #60a5fa; 
}

.tooltip-sanction-reason { 
  margin: 6px 0 0; 
  color: #ffffff; 
  font-size: 12px; 
  line-height: 1.4; 
  background: #dc2626; 
  padding: 8px; 
  border-radius: 6px; 
  border-left: 3px solid #fca5a5; 
  font-weight: 500; 
}

.tooltip-notes { 
  margin: 6px 0 0; 
  color: #fbbf24; 
  font-size: 11px; 
  line-height: 1.4; 
  background: #1f2937; 
  padding: 6px 8px; 
  border-radius: 6px; 
  border-left: 3px solid #fbbf24; 
}

.chips { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 4px; 
  margin-top: 6px; 
}

.chip { 
  display: inline-flex; 
  align-items: center; 
  padding: 2px 6px; 
  border-radius: 999px; 
  background: #111827; 
  border: 1px solid #374151; 
  font-size: 11px; 
  color: #e5e7eb; 
}
