.ranking-card {
  position: relative;
  background: linear-gradient(155deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid var(--stroke);
  border-radius: 18px;
  box-shadow: var(--shadow);
  transition: transform 200ms ease, border 200ms ease, box-shadow 200ms ease;
  cursor: pointer;
  margin-bottom: 1rem;
}

.ranking-card::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at -20% 50%, rgba(79,70,229,0.18), transparent 40%);
  opacity: 0.8;
  pointer-events: none;
  border-radius: inherit;
}

.ranking-card:hover {
  transform: translateY(-4px);
  border-color: rgba(79,70,229,0.4);
  box-shadow: 0 15px 35px rgba(0,0,0,0.5);
}

.ranking-card.expanded {
  border-color: rgba(22,169,250,0.5);
  box-shadow: 0 22px 38px rgba(0,0,0,0.55);
}

.card-main {
  position: relative;
  display: grid;
  grid-template-columns: 32px auto 1fr auto;
  align-items: center;
  gap: 1.35rem;
  padding: 1.25rem 1.6rem;
  z-index: 1;
}

.selecao-checkbox {
  position: relative;
  width: 24px;
  height: 24px;
  cursor: pointer;
}

.selecao-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.selecao-checkbox .checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 24px;
  width: 24px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid var(--stroke);
  border-radius: 6px;
  transition: all 200ms ease;
}

.selecao-checkbox:hover .checkmark {
  border-color: var(--accent);
  background: rgba(79, 70, 229, 0.1);
}

.selecao-checkbox input:checked ~ .checkmark {
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  border-color: var(--accent);
}

.selecao-checkbox .checkmark::after {
  content: '';
  position: absolute;
  display: none;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 12px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.selecao-checkbox input:checked ~ .checkmark::after {
  display: block;
}

.ranking-card.selecionado {
  border-color: rgba(79, 70, 229, 0.6);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.3), 0 15px 35px rgba(0, 0, 0, 0.4);
}

.ranking-card.selecionado::before {
  background: radial-gradient(circle at -20% 50%, rgba(79, 70, 229, 0.3), transparent 40%);
}

.rank {
  min-width: 62px;
  width: auto;
  height: 62px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--text);
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  text-shadow: 0 2px 12px rgba(0,0,0,0.35);
  padding: 0 10px;
}

.rank-number {
  font-size: 1.35rem;
  white-space: nowrap;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.rank-number.rank-digits-4 {
  font-size: 1.1rem;
}

.rank-number.rank-digits-5 {
  font-size: 0.9rem;
}

.rank-number.rank-digits-6 {
  font-size: 0.75rem;
}

.rank-number.rank-digits-7 {
  font-size: 0.65rem;
}

.rank-1 {
  background: linear-gradient(145deg, #fbbf24, #f59e0b);
  color: #0f172a;
}

.rank-2 {
  background: linear-gradient(145deg, #cbd5e1, #94a3b8);
  color: #0f172a;
}

.rank-3 {
  background: linear-gradient(145deg, #fb923c, #f97316);
  color: #0f172a;
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.consultant-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.consultant-area {
  color: var(--muted);
  font-size: 0.95rem;
}

.badge {
  font-size: 0.72rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.4px;
  border: 1px solid rgba(255,255,255,0.25);
  text-transform: uppercase;
  font-weight: 600;
}

.badge-ativo {
  background: linear-gradient(120deg, var(--success), #16a34a);
  color: #fff;
}

.badge-historico {
  background: linear-gradient(120deg, #64748b, #475569);
  color: #fff;
}

.badge-veterano {
  background: linear-gradient(120deg, var(--gold), #f59e0b);
  color: #0f172a;
}

.card-stats {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  background: rgba(255,255,255,0.04);
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--stroke);
}

.stat {
  text-align: center;
  min-width: 78px;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
}

.score-value {
  font-size: 1.9rem;
  font-weight: 800;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-raw-data {
  padding: 0.4rem 0.6rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 6px;
  color: #a5b4fc;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 0.5rem;
}

.btn-raw-data:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
  color: #c7d2fe;
  transform: scale(1.05);
}

.btn-raw-data:active {
  transform: scale(0.95);
}

.expand-icon {
  margin-left: 0.5rem;
  color: var(--muted);
  transition: transform 200ms ease, color 200ms ease;
  font-size: 0.9rem;
}

.ranking-card:hover .expand-icon {
  color: var(--accent-2);
}

.ranking-card.expanded .expand-icon {
  transform: rotate(180deg);
  color: var(--accent-2);
}

.card-details {
  padding: 0 1.6rem 1.35rem;
  border-top: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
  position: relative;
  overflow: visible;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.1rem 1.25rem;
  padding-top: 1.1rem;
}

.detail-section {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 0.9rem 1rem 0.75rem;
  overflow: visible;
}

.detail-section h4 {
  color: var(--accent-2);
  font-size: 0.78rem;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.score-breakdown,
.score-breakdown-total {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
  overflow: visible;
  position: relative;
}

.score-breakdown .score-item,
.score-breakdown-total .score-item,
.score-breakdown .score-item-wrapper .score-item,
.score-breakdown-total .score-item-wrapper .score-item {
  width: 100%;
  height: 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.score-item {
  background: var(--bg-veil);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  text-align: center;
}

.score-item.score-total {
  background: linear-gradient(145deg, rgba(79,70,229,0.2), rgba(22,169,250,0.2));
  border-color: rgba(79,70,229,0.5);
}

.score-item-value {
  font-size: 1.05rem;
  font-weight: 700;
}

.score-item-label {
  font-size: 0.55rem;
  letter-spacing: 0;
  color: var(--muted);
  max-width: 100%;
  padding: 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-item-wrapper {
  position: relative;
  flex: 0 0 calc(33.333% - 0.3rem);
  max-width: calc(33.333% - 0.3rem);
}

.score-item-wrapper .score-item {
  cursor: help;
  transition: transform 150ms ease, border-color 150ms ease;
}

.score-item-wrapper:hover .score-item {
  transform: scale(1.05);
  border-color: var(--accent);
}

.score-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text);
  white-space: pre-line;
  min-width: 180px;
  max-width: 280px;
  text-align: left;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms ease;
  z-index: 100;
  pointer-events: none;
}

.score-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--accent);
}

.score-item-wrapper:hover .score-tooltip {
  opacity: 1;
  visibility: visible;
}

.score-item-wrapper:first-child .score-tooltip {
  left: 0;
  transform: translateX(0);
}

.score-item-wrapper:first-child .score-tooltip::after {
  left: 29px;
  transform: translateX(0);
}

.score-item-wrapper:last-child .score-tooltip {
  left: auto;
  right: 0;
  transform: translateX(0);
}

.score-item-wrapper:last-child .score-tooltip::after {
  left: auto;
  right: 20px;
  transform: translateX(0);
}

.extra-details {
  margin-top: 1.5rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 1rem;
}

.extra-details h4 {
  color: var(--accent-2);
  font-size: 0.82rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}

.list-items {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.5rem;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  font-size: 0.85rem;
}

.list-item .muted {
  color: var(--muted);
  font-size: 0.8rem;
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}

.list-item .pontos {
  color: var(--accent-2);
  font-weight: 700;
  font-size: 0.85rem;
  min-width: 50px;
}

.list-item .ies-nome {
  flex: 1;
  color: var(--text);
  font-weight: 500;
  font-size: 0.85rem;
}

@media (max-width: 1200px) {
  .details-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .card-main {
    grid-template-columns: 28px auto 1fr;
    align-items: flex-start;
  }

  .rank {
    min-width: 56px;
    height: 56px;
    padding: 0 8px;
  }

  .rank-number {
    font-size: 1.1rem;
  }

  .rank-number.rank-digits-5,
  .rank-number.rank-digits-6,
  .rank-number.rank-digits-7 {
    font-size: 0.85rem;
  }

  .card-stats {
    width: 100%;
    justify-content: space-between;
    margin-top: 0.65rem;
    grid-column: 1 / -1;
  }

  .details-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .selecao-checkbox {
    width: 20px;
    height: 20px;
  }

  .selecao-checkbox .checkmark {
    width: 20px;
    height: 20px;
  }

  .selecao-checkbox .checkmark::after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
  }
}

@media (max-width: 640px) {
  .card-stats {
    flex-wrap: wrap;
    gap: 0.85rem;
  }

  .stat {
    flex: 1 1 40%;
  }

  .score-value {
    font-size: 1.6rem;
  }

  .details-grid {
    grid-template-columns: 1fr;
  }
}

.selos-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.selos-container.selos-compacto {
  display: inline-flex;
  margin-left: 0.25rem;
  gap: 0.2rem;
}

.selos-compacto .selo {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.25);
  color: #94a3b8;
  padding: 0.1rem 0.25rem;
  gap: 0.15rem;
  font-size: 0.6rem;
}

.selos-compacto .selo:hover {
  background: rgba(148, 163, 184, 0.2);
  border-color: rgba(148, 163, 184, 0.4);
  color: #cbd5e1;
}

.selos-compacto .selo-icone {
  filter: grayscale(100%) brightness(1.2);
  opacity: 0.85;
  font-size: 0.65rem;
}

.selos-compacto .selo-qtd {
  background: rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
  font-size: 0.5rem;
  padding: 0.05rem 0.2rem;
}

.selo {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 500;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.selo:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.selo-icone {
  font-size: 0.85rem;
  line-height: 1;
}

.selo-label {
  font-size: 0.68rem;
  letter-spacing: 0.2px;
}

.selo-qtd {
  font-size: 0.6rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  margin-left: 0.15rem;
}

.selo-mais {
  background: rgba(255, 255, 255, 0.05);
  border-style: dashed;
  font-size: 0.55rem;
  color: var(--muted);
  padding: 0.1rem 0.2rem;
}

.selo-coord {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(139, 92, 246, 0.1));
  border-color: rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
}

.selo-camara {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0.1));
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}

.selo-bpq {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.25), rgba(34, 197, 94, 0.1));
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.selo-gp {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.35), rgba(251, 191, 36, 0.15));
  border-color: rgba(251, 191, 36, 0.6);
  color: #fcd34d;
}

.selo-premio {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.25), rgba(249, 115, 22, 0.1));
  border-color: rgba(249, 115, 22, 0.4);
  color: #fdba74;
}

.selo-mencao {
  background: linear-gradient(135deg, rgba(203, 213, 225, 0.2), rgba(203, 213, 225, 0.08));
  border-color: rgba(203, 213, 225, 0.35);
  color: #e2e8f0;
}

.selo-orient {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(14, 165, 233, 0.08));
  border-color: rgba(14, 165, 233, 0.35);
  color: #7dd3fc;
}

.selo-orient-prem,
.selo-orient-premio {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.35), rgba(249, 115, 22, 0.2));
  border-color: rgba(249, 115, 22, 0.5);
  color: #fdba74;
}

.selo-orient-mencao {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(203, 213, 225, 0.15));
  border-color: rgba(203, 213, 225, 0.4);
  color: #e2e8f0;
}

.selo-coorient {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.08));
  border-color: rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}

.selo-coorient-prem,
.selo-coorient-premio {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(249, 115, 22, 0.2));
  border-color: rgba(249, 115, 22, 0.5);
  color: #fdba74;
}

.selo-coorient-mencao {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(203, 213, 225, 0.15));
  border-color: rgba(203, 213, 225, 0.4);
  color: #e2e8f0;
}

.tipos-section {
  grid-column: 1 / -1;
  margin-top: 1rem;
}

.tipos-section h4 {
  color: var(--accent-2);
}

.tipos-expandido {
  gap: 0.5rem;
}

.tipos-expandido .tipo-atuacao {
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
}

.tipos-expandido .tipo-icone {
  font-size: 0.8rem;
}

.tipos-expandido .tipo-label {
  font-size: 0.65rem;
}

.selos-section {
  grid-column: 1 / -1;
  margin-top: 1rem;
}

.selos-section .selos-container {
  gap: 0.5rem;
}

.selos-section .selo {
  padding: 0.35rem 0.6rem;
}

.selos-section .selo-icone {
  font-size: 1rem;
}

.selos-section .selo-label {
  font-size: 0.72rem;
}

@media (max-width: 900px) {
  .selos-container.selos-compacto {
    display: none;
  }
}

.link-atuacapes {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 0.9rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  border-radius: 6px;
  text-decoration: none;
  transition: all 200ms ease;
  cursor: pointer;
}

.link-atuacapes:hover {
  color: var(--accent-2);
  background: rgba(79, 70, 229, 0.15);
  border-color: rgba(79, 70, 229, 0.4);
  transform: scale(1.1);
}

.tipos-atuacao-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.tipo-atuacao {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-weight: 500;
  transition: all 150ms ease;
}

.tipo-atuacao:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.25);
}

.tipo-icone {
  font-size: 0.7rem;
  line-height: 1;
  opacity: 0.9;
}

.tipo-label {
  font-size: 0.6rem;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.tipo-mais {
  background: rgba(255, 255, 255, 0.03);
  border-style: dashed;
  font-size: 0.55rem;
  padding: 0.1rem 0.25rem;
}

.tipo-coordenador {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.08));
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.tipo-consultor {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.08));
  border-color: rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

.tipo-avaliador {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(168, 85, 247, 0.08));
  border-color: rgba(168, 85, 247, 0.35);
  color: #d8b4fe;
}

.tipo-premiado {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(251, 191, 36, 0.1));
  border-color: rgba(251, 191, 36, 0.4);
  color: #fcd34d;
}

.tipo-orientador {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.08));
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.tipo-bolsista {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(14, 165, 233, 0.08));
  border-color: rgba(14, 165, 233, 0.35);
  color: #7dd3fc;
}

.tipo-inscrito {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(249, 115, 22, 0.08));
  border-color: rgba(249, 115, 22, 0.35);
  color: #fdba74;
}

.tipo-projeto {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.08));
  border-color: rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}

.tipo-evento {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(236, 72, 153, 0.08));
  border-color: rgba(236, 72, 153, 0.35);
  color: #f9a8d4;
}

.tipo-default {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.25);
  color: #94a3b8;
}

@media (max-width: 900px) {
  .tipos-atuacao-container {
    margin-top: 0.3rem;
  }

  .tipo-atuacao {
    font-size: 0.6rem;
    padding: 0.1rem 0.3rem;
  }

  .tipo-label {
    font-size: 0.55rem;
  }
}
