/* A-LAB — Competiciones. Usa alab-tokens.css, alab-ui.css y alab-shell.css.
   Las clases de tabla, fixture y escudos las genera torneos.js: no renombrar. */

.page--wide { max-width: none; }
.hidden { display: none !important; }

/* Cabecera --------------------------------------------------------- */
.tour-title { display: flex; align-items: center; gap: 14px; }
.tour-logo { width: 44px; height: 44px; object-fit: contain; transition: opacity .2s; }

.league-selector-wrapper { position: relative; z-index: 100; }
.league-dropdown { position: relative; min-width: 200px; cursor: pointer; }
.ld-selected { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); font-weight: 500; transition: border-color .15s; }
.league-dropdown:hover .ld-selected { border-color: var(--ink-3); }
.ld-selected img { width: 22px; height: 22px; object-fit: contain; }
.ld-selected span { flex: 1; }
.ld-caret { color: var(--ink-3); width: 14px; height: 14px; }
.ld-menu { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-float); overflow: hidden; }
.ld-option { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; font-size: var(--fs-md); }
.ld-option:hover { background: var(--surface-2); }
.ld-option img { width: 22px; height: 22px; object-fit: contain; }

/* Barra de herramientas -------------------------------------------- */
.tournament-dash { display: flex; flex-direction: column; gap: 20px; }
.dash-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.dash-tabs { border-bottom: 0; gap: 28px; }
.tab-btn { padding: 10px 0; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; color: var(--ink-3); font: 500 var(--fs-md)/1.4 var(--font-ui); cursor: pointer; }
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--ink); border-bottom-color: var(--brand); }
.global-filters { display: flex; gap: 8px; align-items: center; padding-bottom: 8px; }
.global-filters .select { width: 100px; height: 36px; }
.global-filters .btn { height: 36px; }
.dash-view { display: block; }

/* Clasificación ------------------------------------------------------ */
.standings-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.table-responsive { overflow-x: auto; }
.standings-table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.standings-table th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 12px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.standings-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.standings-table tbody tr:last-child td { border-bottom: 0; }
.standings-table tbody tr:hover td { background: #F7FAF8; }
.standings-table th:first-child, .standings-table td:first-child { padding-left: 20px; }
.standings-table th:last-child, .standings-table td:last-child { padding-right: 20px; }
.text-center { text-align: center !important; }
.standings-pos { font: 500 var(--fs-sm)/1 var(--font-data); color: var(--ink-3); width: 44px; }
.standings-table tbody tr:nth-child(-n+4) .standings-pos { color: var(--brand); font-weight: 600; }
.standings-num { font-family: var(--font-data); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.standings-table td.standings-num:nth-child(3) { font-weight: 600; color: var(--ink); }
.standings-club { min-width: 220px; }
.team-cell-link { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 500; text-decoration: none; }
.team-cell-link:hover { color: var(--brand); text-decoration: none; }
.team-cell-link img { width: 24px; height: 24px; object-fit: contain; flex: none; }
.form-cell { display: inline-flex; gap: 3px; }
.form-cell-empty { color: var(--ink-3); }
.form-badge { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; font: 700 11px/1 var(--font-data); color: #fff; background: var(--res-draw); }
.form-badge-g { background: var(--res-win); }
.form-badge-p { background: var(--res-loss); }
.form-badge-d { background: var(--res-draw); }

/* Fixture ------------------------------------------------------------ */
.fixture-filters { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.fixture-filters .filter-group { min-width: 190px; }
.fixture-filters label { font-size: var(--fs-sm); font-weight: 500; }
#fixture-container { display: flex; flex-direction: column; gap: 8px; }
.fixture-date-header { margin-top: 14px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; color: var(--ink-3); }
.fixture-date-header:first-child { margin-top: 0; }
.match-card-fixture { display: grid; grid-template-columns: minmax(0, 1fr) 190px minmax(0, 1fr) 32px; align-items: center; gap: 16px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; transition: border-color .15s, background-color .15s; }
.match-card-fixture:hover { border-color: var(--brand); background: #FBFDFC; }
.match-team { display: flex; align-items: center; gap: 12px; min-width: 0; font-weight: 500; font-size: var(--fs-lg); }
.match-team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-team:hover span { color: var(--brand); }
.match-team.local { justify-content: flex-end; text-align: right; }
.match-team.visitor { justify-content: flex-start; }
.team-logo-mini { width: 30px; height: 30px; object-fit: contain; flex: none; }
.match-center-col { gap: 6px; }
.match-score { font: 600 var(--fs-xl)/1 var(--font-data); letter-spacing: .02em; color: var(--ink); text-align: center; }
.match-score.pending { font-size: var(--fs-lg); font-weight: 500; color: var(--ink-3); }
.match-tv-row { display: flex; justify-content: center; }
.btn-go-details { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--ink-3); font-size: 11px; position: relative; }
.match-card-fixture:hover .btn-go-details { background: var(--brand-tint); color: var(--brand); }

.tv-btn-fixture { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--surface); color: var(--ink-2); font: 500 11px/1 var(--font-ui); text-decoration: none; cursor: pointer; white-space: nowrap; }
.tv-btn-fixture:hover { background: var(--brand-tint); border-color: var(--brand); color: var(--brand-ink); text-decoration: none; }
.tv-btn-fixture i { color: var(--brand); }
.admin-stream-btn { width: 24px; padding: 0; justify-content: center; }
.stream-admin-mini { display: inline-grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--ink-3); cursor: pointer; }
.stream-admin-mini:hover { background: var(--surface-2); color: var(--ink); }
.stream-admin-del:hover { background: var(--bad-bg); color: var(--bad); border-color: #E3B8B1; }
.tv-badge-fixture { display: inline-flex; align-items: center; gap: 6px; }
.tv-logo-mini { height: 16px; width: auto; object-fit: contain; }
.tv-text-mini { font-size: 11px; font-weight: 600; color: var(--ink-3); }

#view-fixture.fixture-sin-datos .fixture-filters { display: none; }
.empty-state { padding: 56px 20px; }

/* Analítico ---------------------------------------------------------- */
.scatter-section { overflow: hidden; }
.scatter-section .card__head { align-items: flex-end; flex-wrap: wrap; }
.scatter-section .card__head > div:first-child { flex: 1 1 320px; }
.scatter-controls { display: flex; gap: 12px; flex-wrap: wrap; }
.scatter-select-wrap { min-width: 220px; }
.scatter-label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.scatter-chart-wrap { position: relative; width: 100%; padding: 16px 20px 20px; }
.scatter-chart-wrap canvas { width: 100% !important; }
.scatter-placeholder:empty { display: none; }

/* Estados ------------------------------------------------------------ */
.loader, .error-msg { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px 20px; color: var(--ink-3); font-size: var(--fs-md); text-align: center; }
.error-msg { color: var(--bad); }
.empty-state p { margin: 0; }

@media (max-width: 860px) {
  .match-card-fixture { grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr); gap: 8px; padding: 12px; }
  .btn-go-details { display: none; }
  .match-team { flex-direction: column; text-align: center; gap: 6px; font-size: var(--fs-sm); }
  .match-team.local { flex-direction: column-reverse; justify-content: center; text-align: center; }
  .match-team span { white-space: normal; }
  .dash-toolbar { align-items: stretch; }
  .global-filters { padding-bottom: 12px; }
  .scatter-select-wrap { min-width: 0; flex: 1 1 140px; }
}
