:root{
  --bg0:#F7FAFF;
  --bg1:#EEF4FF;
  --card: rgba(255,255,255,.78);
  --card2: rgba(255,255,255,.92);
  --stroke: rgba(15,23,42,.12);
  --text:#0F172A;
  --muted: rgba(15,23,42,.72);
  --accent:#2563EB;
  --accent2:#16A34A;
  --danger:#DC2626;
  --warn:#F59E0B;
  --shadow: 0 16px 40px rgba(2,6,23,.10);
  --radius: 18px;
  --radius2: 14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%;overflow-x:hidden}

/* --- Branding (logo + imagen principal) --- */
.hero-image-wrap{
  width: 100%;
  max-width: 100%;
  margin: 10px 0 14px 0;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden; /* evita ensanchar la página */
}

.hero-image{
  display: block;
  width: 100%;
  max-width: 100%;
  height: 715px;           /* ALTURA VISIBLE */
  object-fit: cover;      /* llena ancho/alto */
  object-position: center;
  border-radius: 14px;
  background: rgba(255,255,255,.0);
  border: 0;
  box-shadow: 0 10px 30px rgba(18,38,63,.10);
}


body{
  margin:0;
  font-family: var(--sans);
  color:var(--text);
  background:
    radial-gradient(1100px 760px at 15% 12%, rgba(37,99,235,.14), transparent 58%),
    radial-gradient(900px 650px at 88% 20%, rgba(37,99,235,.08), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

a{color:inherit; text-decoration:none}
a:hover{opacity:.9; text-decoration:underline}

\.container{
  max-width: 100%;
  margin: 0 auto;
  padding: 22px 18px 40px;
}

.header{
  display:flex;
  gap:16px;
  align-items:flex-start;
  justify-content:space-between;
  margin-bottom: 14px;
}

.brand{
  display:flex;
  gap:14px;
  align-items:center;
}

.badge{
  width:48px; height:48px;
  border-radius: 14px;
  background:
    radial-gradient(18px 18px at 30% 30%, rgba(255,255,255,.25), transparent 70%),
    linear-gradient(135deg, rgba(59,130,246,.9), rgba(34,197,94,.75));
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.12);
}

.title{
  line-height:1.05;
}
.title h1{
  margin:0;
  font-size: 24px;
  letter-spacing:.2px;
}
.title p{
  margin:6px 0 0;
  color:var(--muted);
  font-size: 13px;
}

.top-actions{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
}

/* Header tipo ProCyclingStats (VOLVER | Clasificaciones | Entrar como administrador) */
.pcs-header{
  align-items:center;          /* vertical centrado */
}
.pcs-left,
.pcs-center,
.pcs-right{
  flex:1;
  display:flex;
  align-items:center;
}
.pcs-left{ justify-content:flex-start; }
.pcs-center{ justify-content:center; }
.pcs-right{ justify-content:flex-end; }

.pcs-title{
  font-weight:800;
  letter-spacing:.2px;
  font-size:18px;
}

.pcs-back{ white-space:nowrap; }

.btn, button{
  appearance:none;
  border:1px solid var(--stroke);
  background: var(--card);
  color:var(--text);
  padding:10px 12px;
  border-radius: 14px;
  cursor:pointer;
  font-weight:600;
  font-size: 13px;
  letter-spacing:.2px;
  transition: transform .08s ease, background .2s ease, border-color .2s ease;
}
.btn:hover, button:hover{background: var(--card2);}
.btn:active, button:active{transform: translateY(1px);}
.btn.primary{
  background: linear-gradient(135deg, rgba(59,130,246,.95), rgba(34,197,94,.80));
  border-color: rgba(255,255,255,.18);
}
.btn.ghost{
  background: transparent;
}

.flash{
  margin: 10px 0 14px;
  padding: 12px 14px;
  background: rgba(245,158,11,.12);
  border: 1px solid rgba(245,158,11,.35);
  border-radius: 14px;
  color: rgba(255,255,255,.92);
}

.panel{
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:visible;
}

.panel-head{
  padding: 14px 14px 12px;
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  border-bottom: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.10);
}

.panel-head .left{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.panel-head .kicker{
  font-size: 12px;
  color: var(--muted);
}
.panel-head .h{
  font-size: 15px;
  font-weight: 800;
  letter-spacing:.2px;
}
.meta{
  display:flex; gap:10px; align-items:center;
  color: var(--muted);
  font-size: 12px;
}

.toolbar{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.input{
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.18);
  color: var(--text);
  padding:10px 12px;
  border-radius: 14px;
  outline:none;
  min-width: 220px;
}
.input::placeholder{color: rgba(234,241,255,.55);}

.tabs{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  padding: 12px 14px;
  border-top: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.tab{
  padding:10px 12px;
  border-radius: 999px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.78);
}
.tab.active{
  border-color: rgba(37,99,235,.35);
  background: rgba(37,99,235,.10);
  color: rgba(15,23,42,.92);
}

.content{
  padding: 0;
}

.table-container {
    width: 100%;
    overflow-x: hidden;   /* NO scroll */
}

table {
    width: 100%;
    table-layout: auto;   /* permite crecer columnas */
    white-space: nowrap;  /* TODO en una línea */
}

th, td {
    white-space: nowrap;
}

th, td {
    padding: 12px 14px;
}

thead th{
  position: sticky;
  top: 0;
  z-index: 2;
  text-align:left;
  font-size: 12px;
  letter-spacing:.2px;
  color: rgba(15,23,42,.82);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(15,23,42,.10);
  padding: 12px 12px;
  white-space: normal;
  overflow-wrap: anywhere;
}

tbody td{
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15,23,42,.06);
  color: rgba(15,23,42,.92);
  font-size: 13px;
  white-space: normal;
  overflow-wrap: anywhere;
}
tbody tr:nth-child(2n) td{background: rgba(15,23,42,.02);}
tbody tr:hover td{background: rgba(59,130,246,.10);}

td.num{font-variant-numeric: tabular-nums; font-family: var(--mono); white-space: nowrap;}

/* Reglas visuales */
td.pow-high{
  background: rgba(255,77,109,.18) !important;
  border-bottom-color: rgba(255,77,109,.25);
}

.kv.pow-high{
  background: rgba(255,77,109,.18) !important;
  border-color: rgba(255,77,109,.28) !important;
}
td.multi-x{
  background: rgba(34,197,94,.18) !important;
  border-bottom-color: rgba(34,197,94,.25);
}

.err{
  padding: 14px;
  color: rgba(255,255,255,.92);
  background: rgba(255,77,109,.12);
  border: 1px solid rgba(255,77,109,.28);
  border-radius: 14px;
  white-space: pre-wrap;
  margin: 14px;
}

/* Forms / cards (admin) */
.card{
  max-width: 520px;
  margin: 0 auto;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}
.card label{display:block; font-size: 12px; color:var(--muted); margin-top:10px;}
.card input{
  width:100%;
  margin-top:6px;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.18);
  color: var(--text);
  outline:none;
}
.card .row{display:flex; gap:12px; align-items:center; margin-top:12px; flex-wrap:wrap;}
.small{font-size: 12px; color: var(--muted);}

.footer-note{
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 720px){
  .header{flex-direction:column; align-items:stretch;}
  .top-actions{justify-content:flex-start;}
  .pcs-left,.pcs-center,.pcs-right{justify-content:center;}
  table{min-width: 640px;}
}


@media (max-width: 1100px){
  thead th, td{ padding: 8px 8px; font-size: 12px; }
}

/* ===== FORCE: una sola línea en toda la tabla ===== */
.table-container,
.table-wrap,
.table-responsive {
  overflow-x: hidden !important;     /* sin barra horizontal */
}

table {
  width: 100% !important;
  table-layout: auto !important;      /* columnas se adaptan */
}

th, td {
  white-space: nowrap !important;     /* NO partir en 2 líneas */
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
}

/* si tenías celdas centradas con ancho limitado */
th, td {
  max-width: none !important;
}

/* 1) Que el layout use todo el ancho de la pantalla */
.container, .page, .shell, .card {
  max-width: 100vw !important;
  width: 100vw !important;
}

/* 2) Tabla en una sola línea */
table { white-space: nowrap !important; }
th, td { white-space: nowrap !important; }

/* 3) NO recortar columnas: permitir scroll horizontal SOLO en la tabla */
.table-container, .table-wrap, .table-responsive {
  overflow-x: auto !important;   /* <- este es el cambio clave */
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch;
}

/* ===== COMPACT MODE: intentar que quepa sin scroll ===== */

/* más compacto: menos padding y fuente algo menor */
.table-container table {
  font-size: 13px !important;
}
.table-container th,
.table-container td {
  padding: 10px 10px !important;
  white-space: nowrap !important;
}

/* cabeceras más compactas */
.table-container thead th {
  font-size: 12px !important;
  letter-spacing: .2px;
}

/* columnas “cortables”: recortar con  */
.table-container td:nth-child(2),  /* Ciclista */
.table-container td:nth-child(5),  /* Equipo */
.table-container td:nth-child(6) { /* Trainer */
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* columnas numéricas/pequeñas: forzar estrechas */
.table-container th:nth-child(1),
.table-container td:nth-child(1) { width: 72px; }   /* Posicion */

.table-container th:nth-child(3),
.table-container td:nth-child(3) { width: 92px; }   /* Categoría */

/* ==============================
   ADMIN: Gestionar etapas (layout)
   Evita solapes (Renombrar/fecha)
   ============================== */

table.admin-table{
  table-layout: fixed !important;
}

table.admin-table th,
table.admin-table td{
  white-space: normal !important; /* override global nowrap */
  overflow-wrap: anywhere;
}

table.admin-table th:nth-child(1),
table.admin-table td:nth-child(1){ width: 18%; }

table.admin-table th:nth-child(2),
table.admin-table td:nth-child(2){ width: 52%; }

table.admin-table th:nth-child(3),
table.admin-table td:nth-child(3){ width: 20%; }

table.admin-table th:nth-child(4),
table.admin-table td:nth-child(4){ width: 10%; }

table.admin-table td:nth-child(2){
  overflow: hidden;
}

/* Form renombrar alineado y sin invadir columnas */
table.admin-table .rename-row{
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
}

table.admin-table .rename-row input[type="text"],
table.admin-table .rename-row input.text{
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

table.admin-table .rename-row .btn.small{
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Footer del admin */
.admin-footer{
  margin-top: 14px;
  display: flex;
  justify-content: flex-start;
}

.table-container th:nth-child(4),
.table-container td:nth-child(4) { width: 70px; }   /* Edad */

.table-container th:nth-child(7),
.table-container td:nth-child(7) { width: 78px; }   /* Media Av */

.table-container th:nth-child(8),
.table-container td:nth-child(8) { width: 92px; }   /* Peso aprox. */

.table-container th:nth-child(9),
.table-container td:nth-child(9) { width: 110px; }  /* Potencia Media */

.table-container th:nth-child(10),
.table-container td:nth-child(10) { width: 95px; }  /* Pulso medio */

.table-container th:nth-child(11),
.table-container td:nth-child(11) { width: 110px; } /* Velocidad media */

.table-container th:nth-child(12),
.table-container td:nth-child(12) { width: 88px; }  /* Multiplayer */

.table-container th:nth-child(13),
.table-container td:nth-child(13) { width: 95px; }  /* Tiempo */

.table-container th:nth-child(14),
.table-container td:nth-child(14) { width: 125px; } /* Tiempo revisado */

.table-container th:nth-child(15),
.table-container td:nth-child(15) { width: 95px; }  /* Intervalo */

/* ultra-compact */
.table-container table { font-size: 12px !important; }
.table-container th, .table-container td { padding: 8px 8px !important; }

/* encabezados cortos y centrados */
.table-container thead th { font-size: 11px !important; text-align: center !important; }

/* centrar columnas numéricas y cortas */
.table-container td:nth-child(1),
.table-container td:nth-child(3),
.table-container td:nth-child(4),
.table-container td:nth-child(7),
.table-container td:nth-child(8),
.table-container td:nth-child(9),
.table-container td:nth-child(10),
.table-container td:nth-child(11),
.table-container td:nth-child(12),
.table-container td:nth-child(13),
.table-container td:nth-child(14),
.table-container td:nth-child(15) {
  text-align: center !important;
}

/* recortar columnas largas */
.table-container td:nth-child(2),
.table-container td:nth-child(5),
.table-container td:nth-child(6) {
  max-width: 150px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}


/* ===== Centrado de columnas numéricas / tiempos ===== */
.table-wrap table th:nth-child(7),
.table-wrap table td:nth-child(7),   /* Media Av */
.table-wrap table th:nth-child(8),
.table-wrap table td:nth-child(8),   /* Peso aprox. */
.table-wrap table th:nth-child(9),
.table-wrap table td:nth-child(9),   /* Potencia Media */
.table-wrap table th:nth-child(10),
.table-wrap table td:nth-child(10),  /* Pulso medio */
.table-wrap table th:nth-child(11),
.table-wrap table td:nth-child(11),  /* Velocidad media */
.table-wrap table th:nth-child(12),
.table-wrap table td:nth-child(12),  /* Multiplayer */
.table-wrap table th:nth-child(13),
.table-wrap table td:nth-child(13),  /* Tiempo */
.table-wrap table th:nth-child(14),
.table-wrap table td:nth-child(14),  /* Tiempo revisado */
.table-wrap table th:nth-child(15),
.table-wrap table td:nth-child(15)   /* Intervalo */
{
  text-align: center !important;
}

/* Mantener texto a la izquierda en columnas “de texto” */
.table-wrap table td:nth-child(2),
.table-wrap table td:nth-child(5),
.table-wrap table td:nth-child(6){
  text-align: left !important;
}


.pill{display:inline-block;padding:8px 12px;border-radius:999px;background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.14);font-size:13px;opacity:.9;}


/* ===== Force alignment consistency in tables (General + Stages) ===== */
/* Keep rider name column left, center everything else from column 3 onwards */
#content table thead th:nth-child(2),
#content table tbody td:nth-child(2){
  text-align: left !important;
}
#content table thead th:nth-child(n+3),
#content table tbody td:nth-child(n+3){
  text-align: center !important;
}
#content table thead th:nth-child(1),
#content table tbody td:nth-child(1){
  text-align: center !important;
}



/* ===== STICKY GENERAL: Pos + Ciclista fijos en scroll horizontal ===== */
:root{
  --bg0:#F7FAFF;
  --bg1:#EEF4FF;
  --card: rgba(255,255,255,.78);
  --card2: rgba(255,255,255,.92);
  --stroke: rgba(15,23,42,.12);
  --text:#0F172A;
  --muted: rgba(15,23,42,.72);
  --accent:#2563EB;
  --accent2:#16A34A;
  --danger:#DC2626;
  --warn:#F59E0B;
  --shadow: 0 16px 40px rgba(2,6,23,.10);
  --radius: 18px;
  --radius2: 14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

/* Asegurar que la tabla pueda hacer scroll horizontal */
.table-wrap{
  position: relative;
}

/* Columna Pos */
#tabla-general th.col-pos,
#tabla-general td.col-pos{
  position: sticky;
  left: 0;
  z-index: 6;
  min-width: var(--posw);
  width: var(--posw);
  background: rgba(11,22,48,.96);
}

/* Columna Ciclista */
#tabla-general th.col-ciclista,
#tabla-general td.col-ciclista{
  position: sticky;
  left: var(--posw);
  z-index: 5;
  min-width: var(--cicw);
  background: rgba(11,22,48,.96);
  text-align: left !important;
}

/* Separación visual del bloque sticky */
#tabla-general td.col-ciclista,
#tabla-general th.col-ciclista{
  box-shadow: 10px 0 16px rgba(0,0,0,.25);
}

/* Resaltado automático: mejor tiempo por etapa */
#tabla-general td.best-stage{
  font-weight: 700;
  background: transparent !important;
  outline: 2px solid rgba(22,163,74,.30);
  outline-offset: -2px;
  border-radius: 8px;
}



/* ===== Visuales General: Podio, Top10, Mejor etapa ===== */
#tabla-general tr.podium td{
  font-weight: 700;
}
#tabla-general tr.podium-1 td{
  background: rgba(37,99,235,.06);
}
#tabla-general tr.podium-2 td{
  background: rgba(37,99,235,.04);
}
#tabla-general tr.podium-3 td{
  background: rgba(37,99,235,.03);
}
#tabla-general tr.top10 td{
  background: rgba(59,130,246,0.06);
}

/* Mejor tiempo de etapa (celda) */
#tabla-general td.best-stage{
  outline: 2px solid rgba(34,197,94,0.55);
  outline-offset: -2px;
  border-radius: 8px;
}

/* Mantener fondo de celdas sticky consistente */
#tabla-general #tabla-general td.col-pos,
#tabla-general td.col-ciclista{
  background: rgba(255,255,255,0.96);
}

#tabla-general th.col-pos,
#tabla-general th.col-ciclista{
  background: rgba(11,22,48,.96);
  color: rgba(255,255,255,.92) !important;
}



/* ===== Resumen superior (General) ===== */
.summary-bar{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 12px 0;
}
.summary-card{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: 10px 12px;
  backdrop-filter: blur(6px);
}
.summary-k{
  font-size: 12px;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.summary-v{
  font-size: 16px;
  font-weight: 700;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.summary-s{
  margin-top: 2px;
  font-size: 12px;
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 900px){
  .summary-bar{ grid-template-columns: 1fr; }
}

/* Comparator */
.comparator{
  margin: 10px 0 14px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius2);
  background: rgba(255,255,255,.03);
}
.comp-row{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.comp-row .chk{
  display:flex;
  gap:8px;
  align-items:center;
  font-size: 13px;
  opacity:.9;
}
.comp-chips{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:0;
}
.chip{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding:6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  cursor:pointer;
  user-select:none;
}
.chip b{ opacity:.85; }
.rider-add{
  cursor:pointer;
  text-decoration: none !important;
  text-underline-offset: 3px;
  font-weight: 500;
}
.rider-add:hover{
  text-decoration: none !important;
  color: #4da3ff !important;
}


/* Comparador: nombre clicable en General */
.rider-name{cursor:pointer; text-decoration:none;}
.rider-name:hover{opacity:1; color: var(--accent);}

.comp-intro{
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9fb4d8;
  opacity: 1;
  margin-right: 8px;
}


/* Delta de posición (etapas): ▲▼ + número */
.pos-delta{font-size:0.8rem;font-weight:800;margin-left:6px;white-space:nowrap;}
.pos-delta.up{color:#2ecc71;}
.pos-delta.down{color:#e74c3c;}
.pos-delta.same{color:#9aa0a6;}


/* ===== Visual tweaks (subtle) ===== */
#content .table-wrap{ overflow: visible; }
#content table thead th{
  position: sticky;
  top: 0;
  z-index: 3;
}
#content table tbody tr:nth-child(even){
  background: rgba(255,255,255,0.03);
}
#content table tbody tr:hover{
  background: rgba(59,130,246,0.12);
}
.filter-active{
  font-weight: 800;
  opacity: .95;
  margin-right: 10px;
}


/* Hide small view label above title */
.kicker{ display:none !important; }

/* Rider hover color */
.rider{ text-decoration:none; }
.rider:hover{ color:#2c5fb8; text-decoration:none; }

/* ===============================
   STICKY CABECERA (SCROLL PÁGINA)
   =============================== */

/* Asegurar que ningún wrapper rompe sticky */
.container,
.panel,
.content,
.table-wrap{
  overflow: visible;
}

/* Cabecera fija */
.table thead th,
thead th{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 22, 48, 0.96);
  backdrop-filter: blur(2px);
  /* FIX: ensure header text is readable on dark sticky header */
  color: rgba(255,255,255,.92) !important;
}

/* Evita artefactos visuales */
.table{
  border-collapse: separate;
  border-spacing: 0;
}


/* Branding (logo + imagen principal) */
.brand-logo{
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 12px;
  padding: 4px;
  background: rgba(255,255,255,.85);
  box-shadow: 0 8px 24px rgba(18,38,63,.10);
  display: block;
}


/* Admin previews */
.preview-line{
  margin: 8px 0 10px;
}

.logo-preview{
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(20,40,80,.12);
}

.hero-preview{
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(20,40,80,.12);
}

.checkline{
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 16px;
  color: rgba(15,25,40,.75);
  font-size: 14px;
}

.sep{
  border: 0;
  height: 1px;
  background: rgba(20,40,80,.10);
  margin: 16px 0;
}

.section-title{
  margin: 4px 0 12px;
  font-size: 16px;
}



/* ===============================
   FIX: Columna Pos (filas 11+ oscuras)
   - Mantener cabecera oscura
   - Celdas del cuerpo deben seguir zebra/hover (fondo claro)
   =============================== */
#tabla-general thead th.col-pos{
  background: rgba(11,22,48,.96) !important;
  color: rgba(255,255,255,.92) !important;
}

#tabla-general tbody td.col-pos{
  background: #ffffff !important;
  color: #0f172a !important;
}

#tabla-general tbody tr:nth-child(2n) td.col-pos{
  background: rgba(15,23,42,.02) !important;
}

#tabla-general tbody tr:hover td.col-pos{
  background: rgba(59,130,246,.10) !important;
}

/* Podio coherente también en Pos */
#tabla-general tr.podium-1 td.col-pos{ background: rgba(37,99,235,.06) !important; }
#tabla-general tr.podium-2 td.col-pos{ background: rgba(37,99,235,.04) !important; }
#tabla-general tr.podium-3 td.col-pos{ background: rgba(37,99,235,.03) !important; }

/* --- Cabecera responsive --- */
@media (max-width: 768px){
  .hero-image{ height: 200px; }
}


/* --- Admin: secciones en Ajustes --- */
.settings-section{
  margin: 14px 0;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(20, 32, 55, 0.10);
  background: rgba(255,255,255,0.55);
}
.settings-section .section-title{
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .2px;
  margin-bottom: 6px;
  color: #0b1b3a;
}
.settings-section .section-desc{
  font-size: 12px;
  opacity: .75;
  margin-bottom: 10px;
}
.settings-section label{ margin-top: 10px; }


/* --- Botón detalles de ciclista --- */
.rider-iconbtn{
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
  border: 1px solid rgba(2,6,23,.10);
  background: rgba(255,255,255,.92);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(2,6,23,.06);
  cursor: pointer;
  vertical-align: middle;
  text-decoration: none;
  user-select: none;
}

/* Dentro del grupo de acciones no queremos margen extra */
.rider-actions .rider-iconbtn{ margin-left: 0; }
.rider-iconbtn:hover{
  border-color: rgba(2,6,23,.22);
  box-shadow: 0 14px 32px rgba(2,6,23,.10);
}
.rider-iconbtn:hover{ background: rgba(255,255,255,.96); }
.rider-iconbtn:active{ transform: translateY(1px); }

/* Colores como en la captura */
.rider-profile-link{ color: #6d28d9; }
.rider-details-btn{ color: #0b1b3a; }
.rider-charts-link{ color: #0b1b3a; }

/* Los botones heredan estilos pero quitamos apariencia default */
button.rider-iconbtn{
  padding: 0;
  line-height: 0;
  font-size: 0;
}
.rider-iconbtn svg{ display:block; }

.rider-name{ font-weight: 600; }

/* =========================
   COLUMNA CICLISTA: nombre a la izquierda + iconos alineados a la derecha
   (General y Detalle de etapa)
   ========================= */
td.col-ciclista{
  display: table-cell;
  white-space: nowrap;
  vertical-align: middle;
}
td.col-ciclista .rider-cell-inner{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  min-width:0;
}
td.col-ciclista .rider-name{
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
td.col-ciclista .rider-actions{
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

/* POS más estrecha para que Ciclista tenga más ancho */
th.col-pos, td.col-pos{ width: 56px; min-width: 56px; }

/* Asegurar ancho mínimo de Ciclista (evita que se coma el texto en etapa) */
th.col-ciclista, td.col-ciclista{ min-width: 240px; }

/* --- Modal --- */
.modal.hidden{ display:none; }
.modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
}
.modal-backdrop{
  position:absolute;
  inset:0;
  background: rgba(2,6,23,.55);
}
.modal-card{
  position: relative;
  width: min(760px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow: auto;
  margin: 12px auto;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.modal-open{ overflow:hidden; }

.modal-head{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px 16px;
  border-bottom: 1px solid var(--stroke);
}
.modal-kicker{
  font-size: 12px;
  color: var(--muted);
}
.modal-title{
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.modal-close{
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.9);
  border-radius: 12px;
  padding: 6px 10px;
  cursor:pointer;
  font-size: 14px;
}
.modal-body{
  padding: 12px 16px 2px 16px;
}
.modal-foot{
  padding: 10px 16px 14px 16px;
  border-top: 1px solid var(--stroke);
  display:flex;
  justify-content: flex-end;
}

.modal-section{
  margin: 10px 0 14px 0;
}
.modal-section-title{
  font-weight: 800;
  margin-bottom: 8px;
}
.modal-kv{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.kv{
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.86);
  border-radius: 14px;
  padding: 8px 10px;
}
.kv-note{
  border-left: 4px solid var(--primary);
  background: rgba(59,130,246,.06);
}
.kv .k{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.kv .v{
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  word-break: break-word;
}

@media (max-width: 640px){
  .modal-kv{ grid-template-columns: 1fr; }
}

/* ===== FIX: evitar scroll horizontal en tablas de etapa ===== */
/* Mantener tabla a ancho de pantalla recortando solo columnas largas (Equipo/Trainer) */
.table-container,
.table-wrap,
.table-responsive{
  overflow-x: hidden !important;
}

/* layout fijo para que quepa sin barra horizontal */
#tabla-stage,
#tabla-general{
  width: 100% !important;
  table-layout: fixed !important;
}

/* Compactar un poco */
.table-container table{
  font-size: 13px !important;
}
.table-container th,
.table-container td{
  padding: 8px 8px !important;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Reducir columnas anchas (orden actual: ... Equipo=5, Trainer=6) */
#tabla-stage th:nth-child(5),
#tabla-stage td:nth-child(5){
  max-width: 140px !important;
}
#tabla-stage th:nth-child(6),
#tabla-stage td:nth-child(6){
  max-width: 120px !important;
}

/* === Compact stage table (no horizontal scroll, no overlap) === */
#tabla-stage{
  width:100%;
  table-layout: fixed;
}
#tabla-stage th, #tabla-stage td{
  padding: 8px 10px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

/* Column widths (tuned to avoid horizontal scroll) */
#tabla-stage th:nth-child(1), #tabla-stage td:nth-child(1){ width:40px; }   /* Pos */
#tabla-stage th:nth-child(2), #tabla-stage td:nth-child(2){ width:175px; }  /* Ciclista */
#tabla-stage th:nth-child(3), #tabla-stage td:nth-child(3){ width:80px; }   /* Categoría */
#tabla-stage th:nth-child(4), #tabla-stage td:nth-child(4){ width:55px; }   /* Edad */
#tabla-stage th:nth-child(5), #tabla-stage td:nth-child(5){ width:120px; }  /* Equipo */
#tabla-stage th:nth-child(6), #tabla-stage td:nth-child(6){ width:110px; }  /* Trainer */
#tabla-stage th:nth-child(7), #tabla-stage td:nth-child(7){ width:55px; }   /* Watios */
#tabla-stage th:nth-child(8), #tabla-stage td:nth-child(8){ width:65px; }   /* Peso aprx. */
#tabla-stage th:nth-child(9), #tabla-stage td:nth-child(9){ width:60px; }   /* Dif. Peso */
#tabla-stage th:nth-child(10),#tabla-stage td:nth-child(10){ width:55px; }  /* w/kg */
#tabla-stage th:nth-child(11),#tabla-stage td:nth-child(11){ width:60px; }  /* Pulso med. */
#tabla-stage th:nth-child(12),#tabla-stage td:nth-child(12){ width:60px; }  /* Veloc. med. */
#tabla-stage th:nth-child(13),#tabla-stage td:nth-child(13){ width:50px; }  /* Multip. */
#tabla-stage th:nth-child(14),#tabla-stage td:nth-child(14){ width:75px; }  /* Tiempo */
#tabla-stage th:nth-child(15),#tabla-stage td:nth-child(15){ width:75px; }  /* T. revisado */
#tabla-stage th:nth-child(16),#tabla-stage td:nth-child(16){ width:60px; }  /* Diferen. */

/* Ajustes compactos: POS más estrecha */
#tabla-general th.col-pos, #tabla-general td.col-pos, th.col-pos, td.col-pos{min-width: var(--posw) !important; width: var(--posw) !important;}
#tabla-general td.col-pos, td.col-pos{padding-left:6px !important; padding-right:6px !important;}

/* FIX: Pos más estrecho */
#tabla-general th.col-pos, #tabla-general td.col-pos{ padding-left:6px; padding-right:6px; }


/* =========================
   FIX9: General -> Pos más estrecha, Ciclista más ancha, iconos más pequeños
   (solo ajustes visuales)
   ========================= */
:root{
  --posw: 40px;   /* más estrecha */
  --cicw: 320px;  /* más ancha */
}

/* Tabla GENERAL: columna Pos (1ª) */
#tabla-general th:nth-child(1),
#tabla-general td:nth-child(1),
#tabla-general th.col-pos,
#tabla-general td.col-pos{
  width: var(--posw) !important;
  min-width: var(--posw) !important;
  max-width: var(--posw) !important;
  padding-left: 8px !important;
  padding-right: 8px !important;
}

/* Tabla GENERAL: columna Ciclista (2ª) */
#tabla-general th:nth-child(2),
#tabla-general td:nth-child(2),
#tabla-general th.col-ciclista,
#tabla-general td.col-ciclista{
  width: var(--cicw) !important;
  min-width: var(--cicw) !important;
}

/* Iconos más pequeños (general y etapa, sin cambiar comportamiento) */
.rider-iconbtn,
.icon-btn{
  width: 22px !important;
  height: 22px !important;
}

.rider-iconbtn svg{
  width: 11px !important;
  height: 11px !important;
}

.icon-btn i{
  font-size: 11px !important;
}

.icon-user,
.rider-profile-link{
  font-size: 12px !important;
}

/* --- Ajuste definitivo columna POS --- */
:root{
  --posw: 70px;
}

th.col-pos, td.col-pos{
  width: var(--posw);
  min-width: var(--posw);
  max-width: var(--posw);
  padding: 4px 4px;
  text-align: center;
}

.comp-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
  gap:16px;
}

.comp-card{
  display:block;
  text-decoration:none;
  color:inherit;
  border-radius:14px;
  overflow:hidden;
  background:#fff;
  border:1px solid rgba(0,0,0,.08);
  box-shadow:0 6px 18px rgba(0,0,0,.10);
  transition:transform .15s ease;
}

.comp-card:hover{ transform:translateY(-3px); }

.comp-cover{
  height:150px;
  background-size:cover;
  background-position:center;
}

.comp-body{ padding:12px; }

.comp-title{ font-weight:700; }

.comp-meta{ opacity:.75; margin-top:6px; font-size:.9rem; }

.clock{
  width:18px;
  height:18px;
  margin-right:8px;
  opacity:0.9;
}


/* Icono reloj (Última etapa actualizada) */
.infobar .clock{
  width:22px;
  height:22px;
  margin-right:8px;
  opacity:.95;
  flex:0 0 auto;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.35));
}


.support-btn.tertiary{background:#fff;color:#0f172a;border:1px solid rgba(15,23,42,.12)}
.support-list--recent{max-height:none;overflow:visible}
.support-item--recent{background:linear-gradient(135deg, rgba(251,191,36,.18), rgba(249,115,22,.16));border-color:rgba(249,115,22,.22);color:#9a3412}




/* Equipos: layout estable para buscador y filtros */
.team-rider-search-panel{
  margin-top:14px;
  display:grid;
  gap:12px;
  width:100%;
}

.team-search-input{
  width:100%;
  min-width:0;
  box-sizing:border-box;
}

.team-filter-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:16px 20px;
  width:100%;
}

.team-filter-group{
  display:flex;
  flex-direction:column;
  min-width:0;
}

.team-filter-group label{
  margin-bottom:8px;
}

.team-filter-range{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
  width:100%;
}

.team-filter-range .input,
.team-filter-range input{
  width:100%;
  min-width:0;
  max-width:none;
  box-sizing:border-box;
}

.team-filter-actions{
  display:flex;
  justify-content:flex-end;
}

@media (max-width: 980px){
  .team-filter-grid{
    grid-template-columns:1fr;
  }
}


/* equipos filtros ancho fix definitivo */
.team-rider-search-panel{display:grid;gap:12px;width:100%;}
.team-search-input{width:100%;min-width:0 !important;box-sizing:border-box;}
.team-filter-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px;width:100%;align-items:start;}
.team-filter-group{display:flex;flex-direction:column;min-width:0;}
.team-filter-group label{margin:0 0 8px 0;}
.team-filter-range{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;width:100%;min-width:0;}
.team-filter-range .input,.team-filter-range input{width:100% !important;min-width:0 !important;max-width:none !important;box-sizing:border-box;display:block;}
.team-filter-actions{display:flex;justify-content:flex-end;}
@media (max-width: 980px){.team-filter-grid{grid-template-columns:1fr;}}

/* =========================================================
   VERSION 17-9-6 - RESTORE CLASIFICACIONES DESDE VERSION 13-14
   Se recupera el comportamiento estable de tablas de clasificaciones.
   Solo se mantienen ajustes ajenos a clasificación pública.
   ========================================================= */

/* Admin Supporters: tabla superior con acciones visibles */
.entitlements-table th:nth-child(1),.entitlements-table td:nth-child(1){ width:22% !important; }
.entitlements-table th:nth-child(2),.entitlements-table td:nth-child(2){ width:12% !important; }
.entitlements-table th:nth-child(3),.entitlements-table td:nth-child(3){ width:12% !important; }
.entitlements-table th:nth-child(4),.entitlements-table td:nth-child(4){ width:24% !important; }
.entitlements-table th:nth-child(5),.entitlements-table td:nth-child(5){ width:30% !important; }
.entitlements-table .supporter-admin-actions{display:flex !important;flex-wrap:nowrap !important;gap:8px !important;overflow:visible !important;align-items:center !important;}
.entitlements-table .supporter-admin-actions .supporter-admin-btn{min-width:92px !important;padding:8px 11px !important;font-size:12px !important;}

/* ==========================================================
   VERSION 17-9-7 · FIX DEFINITIVO ANCHO CLASIFICACIONES
   Unifica las reglas contradictorias acumuladas anteriormente.
   ========================================================== */

/* La página ocupa el ancho disponible sin provocar el desbordamiento
   lateral generado por width:100vw + padding. */
html,
body{
  width:100%;
  max-width:100%;
  overflow-x:hidden;
}

body > .container{
  width:100% !important;
  max-width:none !important;
  margin:0 auto !important;
  padding:22px 18px 40px !important;
}

/* El panel y su contenido deben poder utilizar todo el ancho interior. */
body > .container > .panel,
body > .container .content,
body > .container .table-wrap{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
}

/* La clasificación no se recorta ni se comprime artificialmente.
   Cuando hay más columnas de las que caben, el desplazamiento queda
   limitado al contenedor de la tabla. */
body > .container .table-wrap{
  display:block !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  -webkit-overflow-scrolling:touch;
}

body > .container #tabla-general,
body > .container #tabla-stage{
  width:100% !important;
  max-width:none !important;
  table-layout:auto !important;
  border-collapse:collapse;
}

/* La general puede crecer según el número de etapas sin deformar columnas. */
body > .container #tabla-general{
  min-width:max-content !important;
}

/* Las etapas mantienen una anchura mínima legible y usan scroll solo
   cuando la pantalla no permite mostrarlas completas. */
body > .container #tabla-stage{
  min-width:1280px !important;
}

/* Restauración estable de las dos columnas principales. */
:root{
  --posw:52px;
  --cicw:260px;
}

body > .container #tabla-general th.col-pos,
body > .container #tabla-general td.col-pos{
  width:var(--posw) !important;
  min-width:var(--posw) !important;
  max-width:var(--posw) !important;
  padding-left:6px !important;
  padding-right:6px !important;
}

body > .container #tabla-general th.col-ciclista,
body > .container #tabla-general td.col-ciclista{
  width:var(--cicw) !important;
  min-width:var(--cicw) !important;
  max-width:var(--cicw) !important;
}

/* En móvil se conserva el margen de la página y el scroll queda únicamente
   dentro de la clasificación. */
@media (max-width:720px){
  body > .container{
    padding:14px 10px 28px !important;
  }

  body > .container #tabla-general,
  body > .container #tabla-stage{
    width:max-content !important;
  }
}

/* ==========================================================
   VERSION 17-9-8 · ETAPAS A ANCHO COMPLETO + PRIVACIDAD
   ========================================================== */

/* Evita que width:100% aumente por padding o bordes y garantiza
   que panel, contenido y envoltorio compartan exactamente el ancho. */
html,
body,
body > .container,
body > .container > .panel,
body > .container > .panel > .content,
body > .container #content,
body > .container #content > .table-wrap{
  box-sizing:border-box !important;
}

body > .container,
body > .container > .panel,
body > .container #content,
body > .container #content > .table-wrap{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
}

/* La tabla de cada etapa debe ocupar siempre todo el ancho visible.
   En pantallas estrechas conserva un mínimo legible y el scroll queda
   dentro de table-wrap, nunca en la página completa. */
body > .container #content > .table-wrap > #tabla-stage{
  display:table !important;
  width:100% !important;
  min-width:1600px !important;
  max-width:none !important;
  table-layout:fixed !important;
  margin:0 !important;
}

/* En escritorio ancho, el mínimo anterior no limita el crecimiento:
   la tabla se estira hasta el borde derecho del panel. */
@media (min-width:1601px){
  body > .container #content > .table-wrap > #tabla-stage{
    min-width:100% !important;
  }
}

/* Posición y ciclista tienen el mismo tratamiento privado en General
   y en cualquier etapa para visitantes sin registrar. */
#tabla-general td.visitor-private-cell,
#tabla-stage td.visitor-private-cell,
#tabla-general td.visitor-private-cell .rider-name,
#tabla-stage td.visitor-private-cell .rider-name,
#tabla-general td.visitor-private-cell .rider-actions,
#tabla-stage td.visitor-private-cell .rider-actions{
  filter:blur(5px) !important;
  user-select:none !important;
  pointer-events:none !important;
}

/* ==========================================================
   VERSION 17-9-9 · FIX REAL ANCHO COMPLETO DE ETAPAS
   Las anchuras fijas anteriores sumaban ~1520 px con paddings,
   haciendo que la tabla terminase antes que el panel.
   Se sustituyen por proporciones que suman el 100% disponible.
   ========================================================== */

body > .container #content > .table-wrap{
  width:100% !important;
  max-width:none !important;
  overflow-x:hidden !important;
}

body > .container #content > .table-wrap > #tabla-stage{
  width:100% !important;
  min-width:100% !important;
  max-width:100% !important;
  table-layout:fixed !important;
  box-sizing:border-box !important;
}

#tabla-stage th,
#tabla-stage td{
  box-sizing:border-box !important;
}

#tabla-stage th:nth-child(1), #tabla-stage td:nth-child(1){width:3.347% !important;}
#tabla-stage th:nth-child(2), #tabla-stage td:nth-child(2){width:14.644% !important;}
#tabla-stage th:nth-child(3), #tabla-stage td:nth-child(3){width:6.695% !important;}
#tabla-stage th:nth-child(4), #tabla-stage td:nth-child(4){width:4.603% !important;}
#tabla-stage th:nth-child(5), #tabla-stage td:nth-child(5){width:10.042% !important;max-width:none !important;}
#tabla-stage th:nth-child(6), #tabla-stage td:nth-child(6){width:9.205% !important;max-width:none !important;}
#tabla-stage th:nth-child(7), #tabla-stage td:nth-child(7){width:4.603% !important;}
#tabla-stage th:nth-child(8), #tabla-stage td:nth-child(8){width:5.439% !important;}
#tabla-stage th:nth-child(9), #tabla-stage td:nth-child(9){width:5.021% !important;}
#tabla-stage th:nth-child(10),#tabla-stage td:nth-child(10){width:4.603% !important;}
#tabla-stage th:nth-child(11),#tabla-stage td:nth-child(11){width:5.021% !important;}
#tabla-stage th:nth-child(12),#tabla-stage td:nth-child(12){width:5.021% !important;}
#tabla-stage th:nth-child(13),#tabla-stage td:nth-child(13){width:4.184% !important;}
#tabla-stage th:nth-child(14),#tabla-stage td:nth-child(14){width:6.276% !important;}
#tabla-stage th:nth-child(15),#tabla-stage td:nth-child(15){width:6.276% !important;}
#tabla-stage th:nth-child(16),#tabla-stage td:nth-child(16){width:5.021% !important;}

@media (max-width:1100px){
  body > .container #content > .table-wrap{
    overflow-x:auto !important;
  }
  body > .container #content > .table-wrap > #tabla-stage{
    width:1280px !important;
    min-width:1280px !important;
    max-width:none !important;
  }
}

/* ==========================================================
   VERSION 17-9-10 · ANCHO DINÁMICO REAL PARA ETAPAS
   Algunas competiciones muestran 14 columnas y otras 16.
   El reparto fijo de 17-9-9 reservaba espacio para columnas
   inexistentes, por lo que la tabla terminaba antes del panel.
   ========================================================== */

body > .container #content > .table-wrap,
body > .container #content > .table-wrap > #tabla-stage{
  width:100% !important;
  min-width:100% !important;
  max-width:100% !important;
  margin:0 !important;
  box-sizing:border-box !important;
}

body > .container #content > .table-wrap > #tabla-stage{
  display:table !important;
  table-layout:fixed !important;
  border-collapse:collapse !important;
}

/* Anular todos los anchos nth-child antiguos. El navegador reparte
   automáticamente el espacio entre las columnas que realmente existen. */
#tabla-stage th,
#tabla-stage td{
  width:auto !important;
  min-width:0 !important;
  max-width:none !important;
  box-sizing:border-box !important;
}

/* Mantener solo las dos columnas identificativas con proporciones útiles. */
#tabla-stage th.col-pos,
#tabla-stage td.col-pos{
  width:4% !important;
  min-width:0 !important;
  max-width:none !important;
}

#tabla-stage th.col-ciclista,
#tabla-stage td.col-ciclista{
  width:18% !important;
  min-width:0 !important;
  max-width:none !important;
}

/* El banner debe ocupar exactamente todas las columnas renderizadas. */
#tabla-stage .visitor-unlock-row,
#tabla-stage .visitor-unlock-row td,
#tabla-stage .visitor-banner-row,
#tabla-stage .visitor-banner-row td{
  width:auto !important;
  max-width:none !important;
}

@media (max-width:1100px){
  body > .container #content > .table-wrap{
    overflow-x:auto !important;
  }
  body > .container #content > .table-wrap > #tabla-stage{
    width:1280px !important;
    min-width:1280px !important;
    max-width:none !important;
  }
}


/* ==========================================================
   VERSION 17-9-11 · ANCHO DE ETAPA MEDIDO DESDE EL CONTENEDOR
   El ancho final se asigna también desde JavaScript usando el
   tamaño real de #content > .table-wrap. Estas reglas eliminan
   límites residuales anteriores y permiten ese ajuste exacto.
   ========================================================== */
body > .container #content,
body > .container #content > .table-wrap{
  display:block !important;
  width:100% !important;
  min-width:0 !important;
  max-width:none !important;
  box-sizing:border-box !important;
}
body > .container #content > .table-wrap > #tabla-stage{
  display:table !important;
  margin:0 !important;
  table-layout:fixed !important;
  box-sizing:border-box !important;
}


/* ==========================================================
   VERSION 17-9-12 · ETAPAS MEDIDAS DESDE EL PANEL COMPLETO
   La medición anterior usaba table-wrap, que podía encogerse al
   ancho intrínseco de la tabla. Ahora JS toma panel.clientWidth.
   ========================================================== */
#content,
#content > .table-wrap,
#content > .table-wrap > #tabla-stage{
  margin-left:0 !important;
  margin-right:0 !important;
  padding-left:0 !important;
  padding-right:0 !important;
  box-sizing:border-box !important;
  max-width:none !important;
}
#content > .table-wrap{
  display:block !important;
  overflow-x:hidden !important;
}
#content > .table-wrap > #tabla-stage{
  display:table !important;
  table-layout:fixed !important;
  border-collapse:collapse !important;
}


/* ==========================================================
   VERSION 17-9-13 · CORRECCIÓN ESTRUCTURAL DE ETAPAS
   ========================================================== */
#content,#content > .table-wrap{width:100% !important;min-width:0 !important;max-width:100% !important;box-sizing:border-box !important;}
#content > .table-wrap > #tabla-stage{display:table !important;width:100% !important;min-width:100% !important;max-width:100% !important;table-layout:fixed !important;border-collapse:collapse !important;box-sizing:border-box !important;margin:0 !important;}
#tabla-stage col.stage-col-pos{width:4% !important;}
#tabla-stage col.stage-col-ciclista{width:18% !important;}
#tabla-stage th,#tabla-stage td{width:auto !important;min-width:0 !important;max-width:none !important;box-sizing:border-box !important;}


/* VERSION 17-9-17 · FIX nombres de corredores en clasificación de etapa */
#tabla-stage td.col-ciclista{
  display:table-cell !important;
  overflow:hidden !important;
  color:var(--text, #0f172a) !important;
}
#tabla-stage td.col-ciclista .rider-cell-inner{
  display:flex !important;
  align-items:center !important;
  width:100% !important;
  min-width:0 !important;
}
#tabla-stage td.col-ciclista .rider-name{
  display:block !important;
  flex:1 1 auto !important;
  min-width:0 !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
  color:inherit !important;
  opacity:1;
}
#tabla-stage col.stage-col-ciclista{width:22% !important;}

/* 17-9-42 V5: alineación uniforme de posición y variación */
#tabla-general td.col-pos{overflow:hidden !important;}
#tabla-general td.col-pos .pos-cell-inner{display:flex;align-items:center;justify-content:center;gap:4px;width:100%;white-space:nowrap;line-height:1;}
#tabla-general td.col-pos .pos-value{display:inline-flex;align-items:center;justify-content:center;min-width:18px;white-space:nowrap;}
#tabla-general td.col-pos .pos-delta{display:inline-flex;align-items:center;justify-content:center;margin-left:0 !important;flex:0 0 auto;font-size:.72rem;}
@media(max-width:700px){
  :root{--posw:76px;}
  #tabla-general th.col-pos,#tabla-general td.col-pos{min-width:76px !important;width:76px !important;max-width:76px !important;padding-left:4px !important;padding-right:4px !important;}
}
