.raw-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 1rem;
}

.raw-modal {
  background: linear-gradient(180deg, #1a1d2e 0%, #12141f 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 16px;
  width: 95%;
  max-width: 1100px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8), 0 0 60px rgba(99, 102, 241, 0.2);
  overflow: hidden;
}

.raw-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.15), rgba(96, 165, 250, 0.1));
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.raw-modal-title h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  color: #fff;
}

.raw-modal-subtitle {
  font-size: 0.9rem;
  color: #94a3b8;
  margin-top: 0.25rem;
  display: block;
}

.raw-modal-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.view-toggle {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 3px;
}

.view-toggle button {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.view-toggle button:hover {
  color: #fff;
}

.view-toggle button.active {
  background: rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
}

.btn-export-pdf {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  width: 80px;
  min-width: 80px;
  max-width: 80px;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  flex: 0 0 80px;
  position: relative;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.2), rgba(185, 28, 28, 0.3));
  border: 1px solid rgba(220, 38, 38, 0.5);
  border-radius: 8px;
  color: #fca5a5;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
  white-space: nowrap;
  overflow: hidden;
  box-sizing: border-box;
}

.btn-export-pdf-wrap {
  width: 80px;
  height: 36px;
  flex: 0 0 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  overflow: hidden;
}

.btn-export-pdf-wrap .btn-export-pdf {
  width: 100%;
  height: 100%;
}

.btn-export-pdf:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.3), rgba(185, 28, 28, 0.4));
  border-color: rgba(220, 38, 38, 0.7);
  color: #fecaca;
}

.btn-export-pdf:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-export-pdf .pdf-icon {
  width: 18px;
  height: 18px;
}

.btn-export-pdf.loading .pdf-icon {
  opacity: 0;
}

.btn-export-pdf.loading span {
  opacity: 0;
}

.btn-export-pdf.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(252, 165, 165, 0.35);
  border-top-color: #fecaca;
  border-radius: 50%;
  animation: spin-pdf 0.9s linear infinite;
}

@keyframes spin-pdf {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.raw-modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.raw-modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.raw-modal-content {
  flex: 1;
  overflow: auto;
  padding: 1.5rem;
  min-height: 400px;
}

.raw-modal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem;
  color: #94a3b8;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(99, 102, 241, 0.2);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.raw-modal-error {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  color: #fca5a5;
}

.error-icon {
  font-size: 1.75rem;
}

.raw-modal-footer {
  padding: 0.85rem 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.raw-modal-info {
  font-size: 0.8rem;
  color: #64748b;
}

.formatted-view {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.data-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: background 0.2s ease;
}

.section-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.section-icon {
  font-size: 1.25rem;
}

.section-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #e2e8f0;
  flex: 1;
}

.section-count {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.section-toggle {
  color: #64748b;
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.data-section.open .section-toggle {
  transform: rotate(0deg);
}

.section-content {
  padding: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.dados-pessoais-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.dados-pessoais-grid .data-field.destaque {
  grid-column: span 2;
}

.data-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.data-field.destaque .data-value {
  font-size: 1.1rem;
  color: #fff;
  font-weight: 600;
}

.data-label {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-value {
  font-size: 0.95rem;
  color: #cbd5e1;
  word-break: break-word;
}

.data-value.array {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.array-item {
  background: rgba(99, 102, 241, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.nested-object {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  margin-top: 0.5rem;
}

.nested-display {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.nested-display.depth-1,
.nested-display.depth-2 {
  background: rgba(0, 0, 0, 0.15);
  padding: 0.75rem;
  border-radius: 8px;
  margin-top: 0.5rem;
}

.atuacoes-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tipo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 0.75rem;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tipo-badge:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
}

.tipo-badge.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
  color: #c7d2fe;
}

.tipo-count {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.15rem 0.4rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
}

.clear-filter {
  padding: 0.4rem 0.75rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 20px;
  font-size: 0.75rem;
  color: #fca5a5;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clear-filter:hover {
  background: rgba(239, 68, 68, 0.25);
}

.atuacoes-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.atuacao-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.atuacao-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.atuacao-card.atuacao-coordenacao { border-left: 3px solid #6366f1; }
.atuacao-card.atuacao-consultoria { border-left: 3px solid #eab308; }
.atuacao-card.atuacao-premiacao { border-left: 3px solid #22c55e; }
.atuacao-card.atuacao-avaliacao { border-left: 3px solid #f97316; }
.atuacao-card.atuacao-inscricao { border-left: 3px solid #06b6d4; }
.atuacao-card.atuacao-bolsa { border-left: 3px solid #ec4899; }
.atuacao-card.atuacao-orientacao { border-left: 3px solid #8b5cf6; }
.atuacao-card.atuacao-outros { border-left: 3px solid #64748b; }

.atuacao-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.atuacao-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.atuacao-index {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
  min-width: 35px;
}

.atuacao-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.atuacao-tipo {
  font-size: 0.9rem;
  color: #e2e8f0;
  font-weight: 500;
}

.atuacao-summary {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.atuacao-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.atuacao-periodo {
  font-size: 0.75rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.atuacao-periodo .ativo {
  color: #4ade80;
  font-weight: 600;
}

.atuacao-meta-line {
  font-size: 0.72rem;
  color: #7dd3fc;
  text-align: right;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.atuacao-toggle {
  color: #64748b;
  font-size: 1.1rem;
  font-weight: 300;
  width: 24px;
  text-align: center;
}

.atuacao-dados {
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.atuacao-dados .data-field.nested {
  grid-column: 1 / -1;
}

.empty-message {
  text-align: center;
  color: #64748b;
  padding: 2rem;
  font-style: italic;
}

.json-view {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.json-toolbar {
  display: flex;
  justify-content: flex-end;
}

.json-toolbar button {
  padding: 0.5rem 1rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 6px;
  color: #c7d2fe;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.json-toolbar button:hover {
  background: rgba(99, 102, 241, 0.25);
}

.json-toolbar button.copied {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.json-content {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 1.25rem;
  overflow: auto;
  max-height: 60vh;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  color: #94a3b8;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 768px) {
  .raw-modal {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .raw-modal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .raw-modal-header-actions {
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }

  .btn-export-pdf {
    width: 80px !important;
    height: 36px !important;
    flex: 0 0 auto !important;
    align-self: center !important;
  }

  .dados-pessoais-grid {
    grid-template-columns: 1fr;
  }

  .atuacao-header {
    flex-wrap: wrap;
  }

  .atuacao-main {
    order: 1;
    flex: 1 1 100%;
  }

  .atuacao-index {
    order: 2;
  }

  .atuacao-meta {
    order: 3;
    align-items: flex-start;
    width: 100%;
  }

  .atuacao-toggle {
    order: 4;
  }
}
