:root {
  --eef-accent: #166534;
  --eef-accent-2: #0f766e;
  --eef-soft: #e7f8f4;
  --eef-ink: #102a43;
  --eef-card: #ffffff;
  --eef-line: #cfe8e2;
}

.deportistas-eef-page {
  font-family: 'Nunito Sans', sans-serif;
  color: var(--eef-ink);
  padding-bottom: 1rem;
}

.page-toolbar {
  position: relative;
  overflow: visible;
  border-radius: 16px;
  border: 1px solid #d5efe7;
  background:
    radial-gradient(circle at 88% 18%, rgba(153, 246, 228, 0.52), transparent 34%),
    linear-gradient(140deg, #ffffff 0%, #eefbf7 60%, #ecfdf5 100%);
  box-shadow: 0 14px 28px -22px rgba(15, 118, 110, 0.48);
  padding: 0.95rem 1rem;
}

.page-title {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #0f172a;
}

.toolbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.toolbar-actions-mobile .dropdown-menu {
  z-index: 1085;
}

.badge-total {
  border-radius: 999px;
  padding: 0.42rem 0.62rem;
  box-shadow: 0 6px 16px -11px rgba(15, 118, 110, 0.45);
}

.badge-total.badge-total-normal {
  background: linear-gradient(135deg, #bbf7d0 0%, #86efac 100%) !important;
  color: #111827 !important;
}

.badge-total.badge-total-filtered {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%) !important;
  color: #ffffff !important;
}

.filtros-badge-hidden {
  display: none;
}

.table-responsive {
  border: 1px solid #d8ede7;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f6fbfa 100%);
  box-shadow: 0 16px 30px -24px rgba(15, 23, 42, 0.6);
  padding: 0.35rem;
}

.thead-custom th {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 58%, #0b7667 100%);
  color: #ecfeff;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: none;
  padding: 10px 8px;
  white-space: nowrap;
}

.tabla-deportistas {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.tabla-deportistas td,
.tabla-deportistas th {
  padding: 7px 5px;
  font-size: 0.78rem;
}

#tablaDeportistas th.col-name-header {
  min-width: 160px;
}

#tablaDeportistas th.col-club-header {
  min-width: 120px;
}

#tablaDeportistas th.col-federacion-header {
  min-width: 140px;
}

.tabla-deportistas tbody tr:nth-child(odd) td {
  background-color: #ffffff;
}

.tabla-deportistas tbody tr:nth-child(even) td {
  background-color: #f5fbf9;
}

.tabla-deportistas tbody td {
  border-bottom: 1px solid #e0efeb;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.fila-deportista {
  transition: transform 0.18s ease;
}

.fila-deportista:hover {
  transform: translateY(-1px);
  cursor: pointer;
}

.fila-deportista:hover td {
  background-color: #e7f8f4 !important;
  box-shadow: inset 0 0 0 1px #b8e4d8;
}

.white-space-normal {
  white-space: normal !important;
}

.deportista-alto-nivel {
  font-weight: 700;
}

.team-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.team-name {
  white-space: nowrap;
  font-weight: 700;
  color: #234;
}

.team-flag-img {
  height: 20px;
}

.club-flag-mobile-img {
  height: 18px;
}

.participant-name-cell {
  position: relative;
}

.participant-team-mobile {
  margin-top: 4px;
  min-height: 20px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  border: 1px solid rgba(100, 116, 139, 0.3);
  padding: 2px 7px;
  overflow: hidden;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.88) 42%, rgba(255, 255, 255, 0.24) 100%),
    var(--participant-flag-url);
  background-repeat: no-repeat, no-repeat;
  background-position: left top, right center;
  background-size: 100% 100%, auto 100%;
}

.participant-team-mobile span {
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.15;
  color: #0f172a;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  width: 100%;
}

.round-header-mobile {
  display: none;
}

.round-header-desktop {
  display: inline;
}

#tablaDeportistas th.col-round,
#tablaDeportistas td.col-round {
  width: 38px;
  min-width: 38px;
  max-width: 38px;
}

#tablaDeportistas th.col-round.col-round-ef,
#tablaDeportistas td.col-round.col-round-ef {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
}

.club-header-mobile,
.club-federacion-mobile {
  display: none;
}

.btn-back {
  border-radius: 999px;
  padding-left: 0.95rem;
  padding-right: 0.95rem;
}

.col-meta-hidden {
  display: none;
}

.column-toggle-label {
  cursor: pointer;
}

.dataTables_wrapper .dataTables_info {
  color: #3d5a5a;
  font-size: 0.83rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 8px !important;
  border: 1px solid #cde9e1 !important;
  background: #ffffff !important;
  color: #164e63 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: linear-gradient(135deg, #0ea5a3 0%, #0f766e 100%) !important;
  border-color: #0f766e !important;
  color: #ffffff !important;
}

@media (min-width: 992px) {
  .participant-desktop-name {
    font-size: 1.03rem;
    font-weight: 800;
  }

  .team-name-desktop {
    font-size: 0.97rem;
  }
}

@media (min-width: 768px) {
  #tablaDeportistas th:nth-child(1),
  #tablaDeportistas td:nth-child(1) { position: sticky; left: 0; z-index: 2; }
  #tablaDeportistas th:nth-child(2),
  #tablaDeportistas td:nth-child(2) { position: sticky; left: 38px; z-index: 2; }
  #tablaDeportistas th:nth-child(3),
  #tablaDeportistas td:nth-child(3) { position: sticky; left: 198px; z-index: 2; }
  #tablaDeportistas th:nth-child(4),
  #tablaDeportistas td:nth-child(4) {
    position: sticky;
    left: 338px;
    z-index: 2;
    box-shadow: 2px 0 8px rgba(15, 23, 42, 0.12);
  }

  #tablaDeportistas thead th:nth-child(-n+4) { z-index: 3; }
  #tablaDeportistas tbody tr:nth-child(odd) td:nth-child(-n+4) { background-color: #ffffff; }
  #tablaDeportistas tbody tr:nth-child(even) td:nth-child(-n+4) { background-color: #f5fbf9; }
  #tablaDeportistas tbody tr:hover td:nth-child(-n+4) { background-color: #e7f8f4 !important; }
}

@media (max-width: 991px) {
  .page-toolbar {
    gap: 0.7rem;
    align-items: flex-start !important;
    flex-direction: column;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .badge-total {
    margin-left: auto;
  }
}

@media (max-width: 767px) {
  .participant-team-mobile {
    display: none !important;
  }

  .tabla-deportistas td,
  .tabla-deportistas th {
    padding: 6px 4px;
    font-size: 0.74rem;
  }

  .table-responsive {
    border-radius: 12px;
    padding: 0.25rem;
  }

  .round-header-desktop {
    display: none;
  }

  .round-header-mobile {
    display: inline;
  }

  #tablaDeportistas th.col-round,
  #tablaDeportistas td.col-round {
    width: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
  }

  #tablaDeportistas th.col-round.col-round-ef,
  #tablaDeportistas td.col-round.col-round-ef {
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
  }

  .participant-name-cell.participant-name-cell-flag {
    background-image:
      linear-gradient(90deg, rgba(255, 255, 255, 0.99) 0%, rgba(255, 255, 255, 0.95) 55%, rgba(255, 255, 255, 0.74) 82%, rgba(255, 255, 255, 0.35) 100%),
      var(--participant-flag-url) !important;
    background-repeat: no-repeat, no-repeat;
    background-position: left top, right 4px center;
    background-size: 100% 100%, auto 49%;
  }

  .participant-mobile-name {
    position: relative;
    z-index: 1;
    display: block;
    line-height: 1.08;
  }

  .participant-mobile-name .participant-mobile-first,
  .participant-mobile-name .participant-mobile-last {
    display: block;
    font-weight: 700;
  }

  .participant-team-mobile {
    margin-top: 3px;
    min-height: 18px;
    padding: 1px 6px;
  }

  .team-cell {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .team-name {
    white-space: normal;
  }

  .club-header-desktop,
  .club-nombre-desktop,
  .col-federacion-header,
  .col-federacion-cell {
    display: none !important;
  }

  .club-header-mobile,
  .club-federacion-mobile {
    display: block;
  }

  .club-federacion-mobile {
    line-height: 1.15;
  }

  .club-federacion-mobile-nombre {
    font-weight: 700;
  }

  .club-federacion-mobile-fed {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
    color: #475569;
    white-space: nowrap;
  }

  .tabla-deportistas th:nth-child(2),
  .tabla-deportistas td:nth-child(2) {
    min-width: 118px !important;
    width: 118px !important;
    overflow: hidden;
  }

  .tabla-deportistas th:nth-child(3),
  .tabla-deportistas td:nth-child(3) {
    min-width: 104px !important;
    max-width: 130px !important;
    width: 115px !important;
    overflow: hidden;
  }
}
