@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Minimal dark (igual que comparar) */
  --bg0: #0B0F17;
  --bg1: #0F1624;
  --bg2: #121B2C;

  --stroke: rgba(255, 255, 255, .08);
  --stroke2: rgba(255, 255, 255, .12);

  --text: rgba(255, 255, 255, .92);
  --muted: rgba(255, 255, 255, .62);
  --muted2: rgba(255, 255, 255, .42);

  /* ✅ Acento verde marca */
  --accent: #34D399;
  --accent2: #22C55E;
  --danger: #EF4444;

  --r14: 14px;
  --r16: 16px;
  --r20: 20px;

  --ring: 0 0 0 3px rgba(52, 211, 153, .18), 0 0 0 1px rgba(52, 211, 153, .26);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body.players-page {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: var(--bg0);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font-family: inherit;
}

/* Layout */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  /* ✅ coincide con sidebar inyectado */
  gap: 16px;
  padding: 16px;
}

.main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  /* evita overflow */
}

/* Content grid */
.content {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 1100px) {
  .content {
    grid-template-columns: 320px 1fr;
  }
}

@media (max-width: 900px) {
  .content {
    grid-template-columns: 1fr;
  }

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

/* Card minimal */
.card {
  background: var(--bg1);
  border: 1px solid var(--stroke);
  border-radius: var(--r20);
  box-shadow: none;
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 4px 4px 0;
  gap: 12px;
}

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 950;
}

.card-sub {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.tools {
  display: flex;
  gap: 8px;
}

.tool {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, .04);
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
}

.tool:hover {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .12);
}

/* Filters */
.filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.group {
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, .18);
  border-radius: 16px;
  padding: 12px;
}

.group h4 {
  margin: 0 0 10px 0;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .4px;
  color: rgba(255, 255, 255, .86);
  text-transform: uppercase;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.field:last-child {
  margin-bottom: 0;
}

label,
.lbl {
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .2px;
}

.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Controls minimal */
.control {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--stroke2);
  background: var(--bg0);
  color: var(--text);
  padding: 10px 12px;
  font-weight: 650;
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}

.control:focus {
  border-color: rgba(52, 211, 153, .35);
  box-shadow: var(--ring);
}

select option {
  color: #fff;
  background: #0F1624;
}

.rangeHint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-weight: 650;
  font-size: 12px;
  margin-top: 4px;
}

/* Actions */
.filter-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.btn2 {
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke2);
  background: transparent;
  color: var(--text);
  font-weight: 850;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, transform .12s ease;
  white-space: nowrap;
}

.btn2:hover {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .16);
}

.btn2:active {
  transform: translateY(1px);
}

.btn2.primary {
  background: rgba(52, 211, 153, .12);
  border-color: rgba(52, 211, 153, .20);
}

.btn2.primary:hover {
  background: rgba(52, 211, 153, .16);
  border-color: rgba(52, 211, 153, .26);
}

/* Table top */
.tableTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 0 4px;
  flex-wrap: wrap;
}

.search {
  min-width: 260px;
  flex: 1 1 260px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.counter {
  color: var(--muted);
  font-weight: 750;
  font-size: 12px;
}

.pager {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.pill {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, .18);
  white-space: nowrap;
  color: rgba(255, 255, 255, .86);
  font-weight: 800;
}

/* Loading */
.loading {
  padding: 14px;
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, .16);
  color: rgba(255, 255, 255, .72);
  font-weight: 750;
  background: rgba(0, 0, 0, .16);
}

/* Table */
.tableWrap {
  overflow: auto;
  border-radius: 16px;
  display: none;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, .18);
  overflow: hidden;
}

/* ✅ ayuda a que el nombre tenga “canal” para 2 líneas */
thead th:first-child,
tbody td:first-child {
  min-width: 260px;
}

thead th {
  text-align: left;
  font-size: 12px;
  color: rgba(255, 255, 255, .78);
  font-weight: 900;
  padding: 12px 12px;
  border-bottom: 1px solid var(--stroke);
  position: sticky;
  top: 0;
  background: rgba(15, 22, 36, .92);
  cursor: pointer;
  user-select: none;
}

tbody td {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .90);
  font-weight: 650;
  font-size: 13px;
  vertical-align: middle;
}

tbody tr:hover {
  background: rgba(255, 255, 255, .02);
}

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, .03);
  color: rgba(255, 255, 255, .86);
}

.tag.green {
  border-color: rgba(52, 211, 153, .22);
  background: rgba(52, 211, 153, .10);
}

/* =========================================================
   SLICER "UN SOLO" (barra única + 2 thumbs superpuestos)
   ========================================================= */

.slicer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.slicer-title {
  font-weight: 850;
  font-size: 12px;
  color: rgba(255, 255, 255, .82);
}

.slicer-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.range-wrap {
  position: relative;
  height: 28px;
}

.range-track {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .10);
  z-index: 1;
}

.range-wrap input[type="range"] {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  z-index: 2;
  pointer-events: none;
}

.range-wrap input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.range-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .95);
  border: 2px solid rgba(52, 211, 153, .70);
  /* ✅ verde */
  margin-top: -6px;
  pointer-events: auto;
  cursor: pointer;
}

.range-wrap input[type="range"]::-moz-range-track {
  height: 6px;
  background: transparent !important;
  border: none !important;
}

.range-wrap input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .95);
  border: 2px solid rgba(52, 211, 153, .70);
  /* ✅ verde */
  cursor: pointer;
  pointer-events: auto;
}

/* stacking: el MAX arriba del MIN */
#rEdadMin,
#rMinutosMin,
#rAltMin {
  z-index: 2;
}

#rEdadMax,
#rMinutosMax,
#rAltMax {
  z-index: 3;
}

/* Team dropdown (custom) */
.teamDD {
  position: relative;
  width: 100%;
}

.teamDD-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;

  background: var(--bg0);
  border: 1px solid var(--stroke2);
  color: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  transition: border-color .12s ease, box-shadow .12s ease;
}

.teamDD-btn:focus {
  outline: none;
  border-color: rgba(52, 211, 153, .35);
  box-shadow: var(--ring);
}

.teamDD-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex: 0 0 auto;
}

.teamDD-text {
  flex: 1 1 auto;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teamDD-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 999;

  display: none;
  max-height: 280px;
  overflow: auto;

  background: #0F1624;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  padding: 6px;
}

.teamDD.open .teamDD-menu {
  display: block;
}

.teamDD-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
}

.teamDD-item:hover {
  background: rgba(255, 255, 255, .04);
}

.teamDD-item.active {
  background: rgba(52, 211, 153, .10);
}

.teamDD-item img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* Team cell */
.teamCell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.teamLogo {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, .04);
  object-fit: contain;
  flex: 0 0 auto;
}

.teamCell span {
  display: block;
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================
   Row actions (⋯) — enterprise dropdown (portal)
   ========================= */

/* ✅ Nombre (pill verde) consistente (1 o 2 líneas, mismo tamaño) */
.nameCell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nameCell .tag.green {
  /* clave: flex + height fija + overflow hidden */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  width: 150px;
  /* ✅ ajustable: 180/200/220 */
  height: 38px;
  /* ✅ todas iguales */
  padding: 0 14px;

  white-space: normal;
  /* permite 2 líneas */
  font-size: 11.5px;
  /* se mantiene legible */
  line-height: 1.12;
  overflow: hidden;

  overflow-wrap: anywhere;
  /* nombres raros / largos */
  word-break: break-word;
}

/* Botón ⋯ */
.rowActionBtn {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .10);
  color: rgba(255, 255, 255, .88);

  display: inline-flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  user-select: none;
  transition: background .12s ease, border-color .12s ease, transform .12s ease;
}

.rowActionBtn:hover {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .14);
}

.rowActionBtn:active {
  transform: translateY(1px);
}

/* Dropdown global (se inyecta en body) */
.rowActionMenu {
  position: fixed;
  z-index: 9999;
  min-width: 190px;

  background: #0F1624;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;

  padding: 6px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);

  display: none;
}

.rowActionMenu.open {
  display: block;
}

.rowActionItem {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;

  display: flex;
  align-items: center;
  gap: 10px;

  padding: 10px 10px;
  border-radius: 12px;

  color: rgba(255, 255, 255, .90);
  font-weight: 800;
  font-size: 13px;
  text-align: left;
}

.rowActionItem:hover {
  background: rgba(255, 255, 255, .04);
}

.rowActionIcon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;

  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
}

.rowActionItem.is-accent .rowActionIcon {
  background: rgba(52, 211, 153, .08);
  border-color: rgba(52, 211, 153, .18);
}

.rowActionDivider {
  height: 1px;
  margin: 6px 6px;
  background: rgba(255, 255, 255, .10);
}

/* Focus */
.rowActionBtn:focus-visible,
.rowActionItem:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* ✅ Compactar columnas numéricas */
thead th,
tbody td{
  padding: 10px 10px;
}

thead th:nth-child(n+4),
tbody td:nth-child(n+4){
  width: 72px;         /* numéricas más angostas */
  text-align: center;
  white-space: nowrap;
}
