/* ============================================================================================
   Sistema visual único de Sporty. Un solo lenguaje para TODAS las pantallas, tomado del de Tours:
   azul noche, papel cálido, una señal naranja para lo que se puede hacer, botones en mayúscula con
   sombra dura, campos de borde de 2 px y una misma banda de cabecera. Un solo ancho.
   Se carga al final de <head>: pisa a Bootstrap, app.css y theme-v2.css, y deja a Tours (que ya lo
   usa) igual. Cada pantalla nueva se arma con estas piezas; no se inventan variantes.
   ============================================================================================ */
:root {
  --ui-ink: #0f1b2d; --ui-ink-2: #1d2b42; --ui-paper: #faf8f2; --ui-card: #ffffff;
  --ui-line: #e4decf; --ui-line-2: #cfc8b5; --ui-muted: #55606f;
  --ui-signal: #f2542d; --ui-signal-strong: #cc3a12; --ui-signal-hover: #b53210; --ui-lime: #d6f26b;
  --ui-ok: #16794c; --ui-ok-soft: #dff3e8; --ui-bad: #b42318; --ui-bad-soft: #fde7e4;
  --ui-amber: #9a5b0a; --ui-amber-soft: #fdf0d4;
  --ui-radius: 10px; --ui-radius-sm: 8px; --ui-ancho: 1140px;
  --ui-font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ui-display: "Space Grotesk", "Inter", system-ui, sans-serif;
}

/* ------------------------------------------------------------------ página y ancho único */
html[data-brand] body { background: var(--ui-paper); }
html[data-brand] body main.container { max-width: var(--ui-ancho); }
html[data-brand] body main .container, html[data-brand] body main .container-fluid {
  max-width: none !important; padding-left: 0 !important; padding-right: 0 !important;
}
html[data-brand] body main .container.py-4, html[data-brand] body main .container-fluid.py-4 { padding-top: 0 !important; padding-bottom: 0 !important; }
html[data-brand] body main .ph3, html[data-brand] body main .ph3-pagina { max-width: none; }

/* ------------------------------------------------------------------ banda de cabecera */
html[data-brand] body .ui-hero {
  background: var(--ui-ink); color: #fff; border-radius: 14px; padding: 1.5rem 1.6rem 1.6rem;
  position: relative; overflow: hidden; isolation: isolate; margin: 0 0 1.5rem;
}
html[data-brand] body .ui-hero::after {
  content: ""; position: absolute; right: -60px; top: -80px; z-index: -1; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(242, 84, 45, .55), transparent);
}
html[data-brand] body .ui-crumbs {
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .62);
  margin-bottom: .7rem; display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; font-weight: 600;
}
html[data-brand] body .ui-back { display: inline-block; color: rgba(255, 255, 255, .8); font-size: .8rem; font-weight: 600; text-decoration: none; margin-bottom: .6rem; }
html[data-brand] body .ui-back:hover { color: #fff; }
html[data-brand] body .ui-hero-row { display: flex; gap: 1rem 1.5rem; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
html[data-brand] body .ui-hero-text { min-width: 0; flex: 1 1 280px; }
html[data-brand] body .ui-hero h1.ui-title {
  color: #fff; font-family: var(--ui-display); font-weight: 700; letter-spacing: -.02em; text-transform: none;
  font-size: clamp(1.7rem, 4.4vw, 2.6rem); line-height: 1.05; margin: 0; overflow-wrap: anywhere;
}
html[data-brand] body .ui-sub { color: rgba(255, 255, 255, .74); font-size: .92rem; margin: .5rem 0 0; max-width: 62ch; }
html[data-brand] body .ui-hero-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
html[data-brand] body .ui-hero-extra { margin-top: 1.1rem; }
/* Los botones de la banda son todos del mismo tamaño, vengan como vengan de la plantilla. */
html[data-brand] body .ui-hero .btn { min-height: 44px; padding: .72rem 1.05rem; font-size: .78rem; }
html[data-brand] body .ui-hero .btn-outline-secondary, html[data-brand] body .ui-hero .btn-outline-primary, html[data-brand] body .ui-hero .btn-ghost, html[data-brand] body .ui-hero .btn-outline-dark, html[data-brand] body .ui-hero .btn-outline-light, html[data-brand] body .club-hero .btn-outline-secondary, html[data-brand] body .club-hero .btn-outline-primary, html[data-brand] body .club-hero .btn-ghost, html[data-brand] body .club-hero .btn-outline-dark, html[data-brand] body .club-hero .btn-outline-light {
  --bs-btn-color: #fff; --bs-btn-border-color: rgba(255, 255, 255, .7); --bs-btn-hover-bg: #fff; --bs-btn-hover-color: var(--ui-ink);
  --bs-btn-hover-border-color: #fff; --bs-btn-active-bg: #fff; --bs-btn-active-color: var(--ui-ink);
  color: #fff !important; border-color: rgba(255, 255, 255, .7) !important; background: transparent;
}
html[data-brand] body .ui-hero .btn-outline-secondary:hover, html[data-brand] body .ui-hero .btn-outline-primary:hover, html[data-brand] body .ui-hero .btn-ghost:hover, html[data-brand] body .ui-hero .btn-outline-dark:hover, html[data-brand] body .ui-hero .btn-outline-light:hover, html[data-brand] body .club-hero .btn-outline-secondary:hover, html[data-brand] body .club-hero .btn-outline-primary:hover, html[data-brand] body .club-hero .btn-ghost:hover, html[data-brand] body .club-hero .btn-outline-dark:hover, html[data-brand] body .club-hero .btn-outline-light:hover {
  color: var(--ui-ink) !important; background: #fff; border-color: #fff;
}
html[data-brand] body .ui-hero .form-control, html[data-brand] body .ui-hero .form-select { background: #fff; color: var(--ui-ink); }
html[data-brand] body .ui-hero .text-muted { color: rgba(255, 255, 255, .7) !important; }
html[data-brand] body .ui-hero label { color: rgba(255, 255, 255, .85); }
@media (max-width: 575.98px) {
  html[data-brand] body .ui-hero { padding: 1.2rem 1.1rem 1.3rem; margin-bottom: 1.2rem; }
  html[data-brand] body .ui-hero-actions { width: 100%; }
  html[data-brand] body .ui-hero-actions .btn { flex: 1 1 auto; }
}

/* ------------------------------------------------------------------ botones: un solo juego */
html[data-brand] body .btn {
  --bs-btn-font-size: .78rem; --bs-btn-border-width: 2px; --bs-btn-border-radius: var(--ui-radius-sm);
  --bs-btn-padding-x: 1.05rem; --bs-btn-padding-y: .72rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px;
  font-family: var(--ui-font); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; line-height: 1.1;
  border-radius: var(--ui-radius-sm); border-width: 2px; padding: .72rem 1.05rem; text-decoration: none; box-shadow: none;
  transition: transform .08s, box-shadow .08s, background .15s, color .15s, border-color .15s;
}
html[data-brand] body .btn .bi { font-size: .95rem; }
html[data-brand] body .btn:focus-visible { outline: 3px solid var(--ui-lime); outline-offset: 2px; box-shadow: none; }
/* Con relleno: llevan la sombra dura de Tours. */
html[data-brand] body .btn-primary, html[data-brand] body .btn-secondary, html[data-brand] body .btn-dark, html[data-brand] body .btn-danger, html[data-brand] body .btn-success {
  box-shadow: 0 3px 0 rgba(0, 0, 0, .28);
}
html[data-brand] body .btn-primary:hover, html[data-brand] body .btn-secondary:hover, html[data-brand] body .btn-dark:hover, html[data-brand] body .btn-danger:hover, html[data-brand] body .btn-success:hover {
  transform: translateY(-1px); box-shadow: 0 4px 0 rgba(0, 0, 0, .28);
}
html[data-brand] body .btn-primary:active, html[data-brand] body .btn-secondary:active, html[data-brand] body .btn-dark:active, html[data-brand] body .btn-danger:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .28); }
html[data-brand] body .btn-primary {
  --bs-btn-bg: var(--ui-signal-strong); --bs-btn-border-color: var(--ui-signal-strong); --bs-btn-color: #fff;
  --bs-btn-hover-bg: var(--ui-signal-hover); --bs-btn-hover-border-color: var(--ui-signal-hover); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #a02c0d; --bs-btn-active-border-color: #a02c0d; --bs-btn-active-color: #fff;
  background: var(--ui-signal-strong); border-color: var(--ui-signal-strong); color: #fff;
}
html[data-brand] body .btn-primary:hover, html[data-brand] body .btn-primary:focus-visible { background: var(--ui-signal-hover); border-color: var(--ui-signal-hover); color: #fff; }
html[data-brand] body .btn-secondary, html[data-brand] body .btn-dark {
  background: var(--ui-ink); border-color: var(--ui-ink); color: #fff;
  --bs-btn-bg: var(--ui-ink); --bs-btn-border-color: var(--ui-ink); --bs-btn-color: #fff; --bs-btn-hover-bg: var(--ui-ink-2); --bs-btn-hover-border-color: var(--ui-ink-2);
}
html[data-brand] body .btn-secondary:hover, html[data-brand] body .btn-dark:hover { background: var(--ui-ink-2); border-color: var(--ui-ink-2); color: #fff; }
html[data-brand] body .btn-success { background: var(--ui-ok); border-color: var(--ui-ok); color: #fff; }
html[data-brand] body .btn-danger { background: var(--ui-bad); border-color: var(--ui-bad); color: #fff; }
/* Con borde: el «fantasma» de Tours. */
html[data-brand] body .btn-outline-primary, html[data-brand] body .btn-outline-secondary, html[data-brand] body .btn-outline-dark, html[data-brand] body .btn-ghost, html[data-brand] body .btn-light {
  background: transparent; color: var(--ui-ink); border-color: var(--ui-ink);
  --bs-btn-color: var(--ui-ink); --bs-btn-border-color: var(--ui-ink); --bs-btn-hover-bg: var(--ui-ink); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: var(--ui-ink);
  --bs-btn-active-bg: var(--ui-ink); --bs-btn-active-color: #fff;
}
html[data-brand] body .btn-light { background: #fff; }
html[data-brand] body .btn-outline-primary:hover, html[data-brand] body .btn-outline-secondary:hover, html[data-brand] body .btn-outline-dark:hover, html[data-brand] body .btn-ghost:hover, html[data-brand] body .btn-light:hover,
html[data-brand] body .btn-outline-secondary.active, html[data-brand] body .btn-outline-primary.active { background: var(--ui-ink); color: #fff !important; border-color: var(--ui-ink); }
html[data-brand] body .btn-outline-danger { background: transparent; color: var(--ui-bad); border-color: var(--ui-bad); --bs-btn-color: var(--ui-bad); --bs-btn-hover-bg: var(--ui-bad); --bs-btn-hover-border-color: var(--ui-bad); }
html[data-brand] body .btn-outline-danger:hover { background: var(--ui-bad); color: #fff; border-color: var(--ui-bad); }
html[data-brand] body .btn-link { border-color: transparent; background: transparent; color: var(--ui-ink); text-decoration: underline; text-transform: none; letter-spacing: 0; min-height: 0; padding: .3rem .4rem; box-shadow: none; }
html[data-brand] body .btn-link:hover { color: var(--ui-signal-strong); transform: none; box-shadow: none; }
/* Tamaños: la acción de una fila y los botones de solo ícono van en el chico. */
html[data-brand] body .btn-sm { --bs-btn-font-size: .7rem; min-height: 36px; padding: .5rem .75rem; font-size: .7rem; gap: .4rem; }
html[data-brand] body .btn-lg { min-height: 52px; padding: .9rem 1.4rem; font-size: .85rem; }
html[data-brand] body .btn.btn-ico { padding: 0; min-width: 36px; }
html[data-brand] body .btn.btn-ico:not(.btn-sm) { min-width: 44px; }
html[data-brand] body .btn[disabled], html[data-brand] body .btn.disabled { opacity: .55; box-shadow: none; transform: none; pointer-events: none; }

/* ------------------------------------------------------------------ campos y filtros */
html[data-brand] body .form-control, html[data-brand] body .form-select, html[data-brand] body textarea.form-control, html[data-brand] body .input-group-text {
  min-height: 44px; border: 2px solid var(--ui-line); border-radius: var(--ui-radius-sm); padding: .65rem .75rem;
  font: 500 .92rem/1.3 var(--ui-font); color: var(--ui-ink); background-color: #fff; box-shadow: none;
}
html[data-brand] body .form-select { padding-right: 2.2rem; }
html[data-brand] body .form-control:hover, html[data-brand] body .form-select:hover { border-color: var(--ui-line-2); }
html[data-brand] body .form-control:focus, html[data-brand] body .form-select:focus { outline: none; border-color: var(--ui-ink); box-shadow: 0 0 0 4px var(--ui-lime); background-color: #fff; color: var(--ui-ink); }
html[data-brand] body .form-control::placeholder { color: #8b93a0; }
html[data-brand] body .form-control-sm, html[data-brand] body .form-select-sm { min-height: 36px; padding: .4rem .65rem; font-size: .85rem; }
html[data-brand] body textarea.form-control { min-height: 84px; }
html[data-brand] body .form-label, html[data-brand] body label.form-label { font-weight: 700; font-size: .8rem; color: var(--ui-ink); margin-bottom: .35rem; text-transform: none; letter-spacing: 0; }
html[data-brand] body .form-text, html[data-brand] body .form-hint { color: var(--ui-muted); font-size: .78rem; }
html[data-brand] body .form-check-input:checked { background-color: var(--ui-signal-strong); border-color: var(--ui-signal-strong); }
html[data-brand] body .form-check-input:focus { box-shadow: 0 0 0 4px var(--ui-lime); border-color: var(--ui-ink); }
html[data-brand] body .input-group > .form-control, html[data-brand] body .input-group > .form-select { min-height: 44px; }
/* Fichas de filtro: una sola forma en toda la app. */
html[data-brand] body .filter-chip, html[data-brand] body .rank-chip, html[data-brand] body .ui-chip, html[data-brand] body .ph3-chip {
  display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; user-select: none; white-space: nowrap;
  border: 2px solid var(--ui-line); border-radius: 999px; padding: .4rem .95rem; background: #fff; color: var(--ui-ink);
  font: 700 .78rem/1.1 var(--ui-font); text-decoration: none; transition: border-color .12s, background .12s, color .12s;
}
html[data-brand] body .filter-chip:hover, html[data-brand] body .rank-chip:hover, html[data-brand] body .ui-chip:hover, html[data-brand] body .ph3-chip:hover { border-color: var(--ui-ink); color: var(--ui-ink); }
html[data-brand] body .filter-chip.active, html[data-brand] body .rank-chip[aria-selected="true"], html[data-brand] body .ui-chip.active, html[data-brand] body .ui-chip[aria-current] {
  background: var(--ui-ink); border-color: var(--ui-ink); color: #fff;
}

/* ------------------------------------------------------------------ tarjetas y tablas */
html[data-brand] body .card, html[data-brand] body .surface {
  background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: var(--ui-radius);
  box-shadow: 0 1px 0 rgba(15, 27, 45, .04); transform: none;
}
html[data-brand] body .card:hover { transform: none; box-shadow: 0 1px 0 rgba(15, 27, 45, .04); border-color: var(--ui-line); }
html[data-brand] body .card-header {
  background: transparent; border-bottom: 1px solid var(--ui-line); padding: .8rem 1.1rem; color: var(--ui-muted);
  font: 700 .74rem/1.2 var(--ui-font); letter-spacing: .08em; text-transform: uppercase;
}
html[data-brand] body .card-body { padding: 1.1rem 1.2rem; }
html[data-brand] body .table { --bs-table-bg: transparent; --bs-table-hover-bg: #faf6ea; --bs-table-striped-bg: transparent; color: var(--ui-ink); font-size: .9rem; }
html[data-brand] body .table > thead th {
  background: transparent; color: var(--ui-muted); font: 700 .7rem/1.2 var(--ui-font); letter-spacing: .08em; text-transform: uppercase;
  border-bottom: 2px solid var(--ui-line); padding: .7rem .75rem;
}
html[data-brand] body .table > :not(caption) > * > * { border-bottom-color: var(--ui-line); padding: .7rem .75rem; vertical-align: middle; }
html[data-brand] body .table-hover > tbody > tr:hover > * { background: #faf6ea; color: var(--ui-ink); }
html[data-brand] body .pill, html[data-brand] body .badge {
  border-radius: 6px; font: 700 .68rem/1 var(--ui-font); letter-spacing: .06em; text-transform: uppercase; padding: .3rem .5rem;
}
html[data-brand] body .alert { border-radius: var(--ui-radius); border-width: 1px; font-size: .92rem; }
html[data-brand] body .modal-content { border: 1px solid var(--ui-line); border-radius: 14px; }
html[data-brand] body .dropdown-menu { border: 1px solid var(--ui-line); border-radius: var(--ui-radius); box-shadow: 0 12px 30px -16px rgba(15, 27, 45, .35); }
html[data-brand] body .eyebrow { color: var(--ui-muted); font: 700 .68rem/1.2 var(--ui-font); letter-spacing: .12em; text-transform: uppercase; }
html[data-brand] body h2.section-title, html[data-brand] body .section-title { font-family: var(--ui-font); }

/* En la barra superior los botones de borde son más discretos. */
html[data-brand] body .navbar .btn-ghost, html[data-brand] body .navbar .btn-outline-secondary { border-color: var(--ui-line); }
html[data-brand] body .navbar .btn-ghost:hover { border-color: var(--ui-ink); }

/* ------------------------------------------------------------------ barra de filtros (debajo de la banda) */
html[data-brand] body .ui-filtros {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .8rem; margin: -.5rem 0 1.4rem; padding: .8rem 1rem;
  background: #fff; border: 1px solid var(--ui-line); border-radius: var(--ui-radius);
}
html[data-brand] body .ui-filtros form { display: flex; flex-wrap: nowrap; align-items: center; gap: .5rem; margin: 0; }
html[data-brand] body .ui-filtros .form-control, html[data-brand] body .ui-filtros .form-select { min-height: 44px; font-size: .9rem; padding: .55rem .75rem; min-width: 0; }
html[data-brand] body .ui-filtros .btn { min-height: 44px; }
html[data-brand] body .ui-filtros label { white-space: nowrap; font-weight: 700; font-size: .78rem; color: var(--ui-muted); margin: 0; }
@media (max-width: 575.98px) {
  html[data-brand] body .ui-filtros form { flex-wrap: nowrap; }
  html[data-brand] body .ui-filtros form input.form-control, html[data-brand] body .ui-filtros form .form-select { flex: 1 1 0; width: auto; min-width: 0 !important; }
  html[data-brand] body .ui-filtros form, html[data-brand] body .ui-filtros .form-control, html[data-brand] body .ui-filtros .form-select { width: 100%; }
}

/* acciones de la banda: siempre envuelven, nunca desbordan */
html[data-brand] body .ui-hero .d-flex, html[data-brand] body .ui-hero-actions { flex-wrap: wrap; }
html[data-brand] body .ui-hero .btn { max-width: 100%; }

/* los botones nunca se encogen por debajo de su texto */
html[data-brand] body .btn { flex-shrink: 0; white-space: nowrap; }
html[data-brand] body .ui-filtros .btn .bi.me-1 { margin-right: 0 !important; }

/* la banda siempre ocupa todo el ancho, aunque la plantilla la meta en una fila flex */
html[data-brand] body .ui-hero { width: 100%; flex: 1 1 100%; box-sizing: border-box; }

/* contenedores anidados de plantillas viejas: sin relleno propio, para que la banda quede a la misma altura en todas */
html[data-brand] body main.container .container { padding: 0 !important; }

/* tablas de posiciones: números angostos y el nombre con todo el espacio que sobra */
html[data-brand] body .tabla-competidores th, html[data-brand] body .tabla-competidores td { padding-left: .3rem; padding-right: .3rem; }
html[data-brand] body .tabla-competidores th { white-space: nowrap; letter-spacing: .04em; }
html[data-brand] body .tabla-competidores th:not(:first-child):not(:nth-child(2)),
html[data-brand] body .tabla-competidores td:not(:first-child):not(:nth-child(2)) { width: 2.6rem; }
html[data-brand] body .tabla-competidores td:nth-child(2) { white-space: normal; overflow: visible; text-overflow: clip; }
html[data-brand] body .tabla-competidores th:first-child, html[data-brand] body .tabla-competidores td:first-child { padding-left: .75rem; }

/* los paneles de pestañas no son controles: sin aro de foco (salía al entrar por #panel-…) */
html[data-brand] body .tab-pane:focus, html[data-brand] body .tab-pane:focus-visible, html[data-brand] body [role="tabpanel"]:focus-visible { outline: 0; }

html[data-brand] body .latido { background: #ff6b4a; }
html[data-brand] body .ui-hero .ui-chip { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff; }
html[data-brand] body .ui-title .latido { display: inline-block; vertical-align: middle; width: .7rem; height: .7rem; margin-right: .35rem; }

/* ficha del club: mismo lenguaje que la banda azul */
html[data-brand] body .club-hero { background: var(--ui-ink); border: 0; color: #fff; border-radius: var(--ui-radius-lg, 14px); }
html[data-brand] body .club-hero::before { display: none; }
html[data-brand] body .club-hero .club-title, html[data-brand] body .club-hero h1, html[data-brand] body .club-hero .eyebrow { color: #fff !important; }
html[data-brand] body .club-hero .text-muted, html[data-brand] body .club-hero .small { color: rgba(255,255,255,.75) !important; }
html[data-brand] body .club-hero .btn-primary { background: var(--ui-signal-strong, #cc3a12); border-color: var(--ui-signal-strong, #cc3a12); color: #fff; }
html[data-brand] body .club-hero .club-actions .btn { min-height: 44px; }

/* botones dentro de tablas: compactos (una fila de tabla no es un formulario) y sin sombra dura */
html[data-brand] body table .btn { white-space: nowrap; }
html[data-brand] body table .btn-sm { min-height: 30px; padding: .25rem .6rem; font-size: .68rem; letter-spacing: .03em; border-width: 1.5px; gap: .3rem; box-shadow: none; }
html[data-brand] body table .btn-sm:hover { transform: none; box-shadow: none; }
html[data-brand] body table .btn-sm .bi { font-size: .85rem; }
html[data-brand] body table .btn-sm.btn-ico { min-width: 30px; width: 30px; padding: 0; }
html[data-brand] body table td .d-inline-flex, html[data-brand] body table td .btn-group { flex-wrap: nowrap; }

/* una barra de filtros sin nada dentro (el filtro no aplica a este usuario) no se muestra */
html[data-brand] body .ui-filtros:not(:has(form, input, select, a, button)) { display: none; }

/* Avatar con iniciales: el mismo en todas las pantallas (el tamaño lo pone cada una en línea cuando hace falta). */
.avatar-xl { display: grid; place-items: center; flex: none; width: 72px; height: 72px; border-radius: 20px; background: #14233b; color: #fff; font-weight: 800; letter-spacing: .02em; }

