/* V2 · components.css — primitivas visuales reutilizables */

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5); border-radius: var(--r-md);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 700; font-size: var(--fs-sm); line-height: 1; transition: var(--t-fast); white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--brand { background: var(--brand-grad); color: var(--brand-contrast); border-color: transparent; }
.btn--brand:hover { color: var(--brand-contrast); filter: brightness(1.06); }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--surface); }
.btn--danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn--danger:hover { color: #fff; filter: brightness(1.05); }
.btn--outline { background: transparent; border-color: var(--brand); color: var(--brand); }
.btn--sm { padding: var(--sp-2) var(--sp-3); font-size: var(--fs-xs); border-radius: var(--r-sm); }
.btn--lg { padding: var(--sp-4) var(--sp-6); font-size: var(--fs-base); }
.btn--block { width: 100%; }
.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: v2spin .7s linear infinite; color: var(--brand-contrast); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-5); box-shadow: var(--shadow-sm); }
/* Tarjeta base reutilizable: fondo/borde/sombra (el padding lo pone cada uso). La usan POS,
   fusión de usuarios, tickets, clases abiertas… Sin esta regla las tarjetas no se delimitan. */
.v2-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.v2-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.v2-card__title { font-size: var(--fs-md); }
.v2-card__actions { display: flex; gap: var(--sp-2); }

/* Guías de ayuda (centro de ayuda admin + pestaña Ayuda de la academia): capturas y títulos */
.v2-help-guide img.v2-help-shot { display: block; max-width: min(100%, 720px); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-sm); margin: var(--sp-3) 0; }
.v2-help-guide h4 { margin: var(--sp-4) 0 var(--sp-2); }

/* Cabecera de página */
.v2-pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-6); flex-wrap: wrap; }
.v2-pagehead__main { display: flex; align-items: center; gap: var(--sp-4); }
.v2-pagehead__icon { width: 48px; height: 48px; border-radius: var(--r-md); display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 15%, transparent); color: var(--brand); }
.v2-pagehead__title { font-size: var(--fs-2xl); }
.v2-pagehead__subtitle { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.v2-pagehead__actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* KPIs y grid */
.v2-grid { display: grid; gap: var(--sp-4); }
.v2-grid--1 { grid-template-columns: 1fr; } /* hubs con un solo bloque visible (módulos apagados) */
.v2-grid--2 { grid-template-columns: repeat(2, 1fr); }
.v2-grid--3 { grid-template-columns: repeat(3, 1fr); }
.v2-grid--4 { grid-template-columns: repeat(4, 1fr); }
.v2-grid--auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
@media (max-width: 860px) { .v2-grid--2, .v2-grid--3, .v2-grid--4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .v2-grid--2, .v2-grid--3, .v2-grid--4 { grid-template-columns: 1fr; } }

.v2-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-5); position: relative; overflow: hidden; }
.v2-kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand); }
.v2-kpi--accent::before { background: var(--accent); }
.v2-kpi--gold::before { background: var(--gold); }
.v2-kpi--danger::before { background: var(--danger); }
.v2-kpi__value { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.v2-kpi__label { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--sp-2); }
.v2-kpi__hint { color: var(--text-soft); font-size: var(--fs-xs); margin-top: var(--sp-1); }
.v2-kpi__trend { position: absolute; top: var(--sp-4); right: var(--sp-4); font-size: var(--fs-xs); font-weight: 700; }
.v2-kpi__trend.is-up { color: var(--success); } .v2-kpi__trend.is-down { color: var(--danger); }

/* ---------- Badges ---------- */
.v2-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border); }
.v2-badge--brand { background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--brand); border-color: transparent; }
.v2-badge--success { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); border-color: transparent; }
.v2-badge--warn { background: color-mix(in srgb, var(--warning) 20%, transparent); color: var(--warning); border-color: transparent; }
.v2-badge--danger { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); border-color: transparent; }
.v2-badge--accent { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); border-color: transparent; }

/* ---------- Tablas ---------- */
.v2-table-wrap { display: flex; flex-direction: column; gap: var(--sp-3); }
.v2-table__toolbar { display: flex; gap: var(--sp-2); }
.v2-table__search { max-width: 320px; }
.v2-table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); }

/* Pista de scroll horizontal (tablas anchas / cuadros). El degradado aparece en el lado con
   contenido oculto y se oculta en los extremos; lo gestiona ui/scrollx.js alternando has-l/has-r. */
.v2-scrollx { position: relative; }
.v2-scrollx::before, .v2-scrollx::after {
  content: ""; position: absolute; top: 1px; bottom: 1px; width: 34px;
  pointer-events: none; z-index: 4; opacity: 0; transition: opacity .15s ease;
}
.v2-scrollx::before { left: 1px; background: linear-gradient(to right, var(--surface), transparent); border-radius: var(--r-lg) 0 0 var(--r-lg); }
.v2-scrollx::after { right: 1px; background: linear-gradient(to left, var(--surface), transparent); border-radius: 0 var(--r-lg) var(--r-lg) 0; }
.v2-scrollx.has-l::before { opacity: 1; }
.v2-scrollx.has-r::after { opacity: 1; }
.v2-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.v2-table thead th { text-align: left; padding: var(--sp-3) var(--sp-4); color: var(--muted); font-weight: 700; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.v2-table th.is-sortable { cursor: pointer; user-select: none; }
.v2-table th.is-sortable:hover { color: var(--brand); }
.v2-table tbody td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
.v2-table tbody tr:last-child td { border-bottom: none; }
.v2-table tbody tr:hover { background: var(--surface-2); }
.v2-table .is-right { text-align: right; } .v2-table .is-center { text-align: center; }
.v2-table__empty { text-align: center; color: var(--muted); padding: var(--sp-7) !important; }
.v2-table__rowactions { display: flex; gap: var(--sp-2); justify-content: flex-end; }
.v2-pager { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-2); }
.v2-pager__info { font-size: var(--fs-sm); color: var(--muted); }

/* ---------- Formularios ---------- */
.v2-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
@media (max-width: 620px) { .v2-form__grid { grid-template-columns: 1fr; } }
.v2-field { display: flex; flex-direction: column; gap: var(--sp-2); }
.v2-field--full { grid-column: 1 / -1; }
.v2-field__label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-soft); }
.v2-req { color: var(--danger); }
.v2-field__hint { color: var(--muted); font-size: var(--fs-xs); }
.v2-input, .v2-select {
  width: 100%; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md);
  border: 1px solid var(--border-strong); background: var(--bg-2); color: var(--text);
  font-size: var(--fs-sm); transition: var(--t-fast);
}
.v2-input:focus, .v2-select:focus { border-color: var(--brand); }
/* Las <option> nativas del desplegable no heredaban color/fondo fiables → en tema claro salían
   invisibles. Forzamos fondo y texto del menú para que se vean en ambos temas. */
.v2-select option, .v2-input option { background: var(--surface); color: var(--text); }
textarea.v2-input { resize: vertical; }
.v2-check { display: inline-flex; align-items: center; gap: var(--sp-2); cursor: pointer; }
.v2-form__error { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); font-size: var(--fs-sm); margin-bottom: var(--sp-4); }
.v2-form__actions { display: flex; gap: var(--sp-3); justify-content: flex-end; margin-top: var(--sp-5); }

/* ---------- Modales ---------- */
.v2-modal-open { overflow: hidden; }
/* Overlay con flex + scroll y modal con margin:auto: si el modal supera el alto visible
   (movil vertical, teclado, etc.) se puede hacer scroll en el overlay en vez de recortarse
   por arriba (con grid place-items:center el header y el boton de cerrar quedaban fuera). */
.v2-modal-overlay { position: fixed; inset: 0; z-index: 100; display: flex; overflow-y: auto; padding: var(--sp-4); background: rgba(3,10,8,.6); backdrop-filter: blur(4px); animation: v2fade .16s ease; }
.v2-modal-overlay.is-out { animation: v2fade .16s ease reverse; }
.v2-modal { width: 100%; margin: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); max-height: 90vh; max-height: calc(100dvh - 2 * var(--sp-4)); display: flex; flex-direction: column; animation: v2pop .18s cubic-bezier(.2,.9,.3,1.2); }
.v2-modal--sm { max-width: 420px; } .v2-modal--md { max-width: 560px; } .v2-modal--lg { max-width: 820px; } .v2-modal--xl { max-width: 1040px; }
.v2-modal__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-5) var(--sp-5) var(--sp-3); flex-shrink: 0; }
.v2-modal__title { font-size: var(--fs-lg); }
.v2-modal__close, .v2-sheet__close { width: 34px; height: 34px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2); font-size: 22px; line-height: 1; color: var(--muted); }
.v2-modal__close:hover { color: var(--danger); border-color: var(--danger); }
.v2-modal__body { padding: var(--sp-2) var(--sp-5) var(--sp-5); overflow-y: auto; }
.v2-modal__foot { display: flex; gap: var(--sp-3); justify-content: flex-end; padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border); flex-shrink: 0; }
@keyframes v2fade { from { opacity: 0; } } @keyframes v2pop { from { opacity: 0; transform: translateY(12px) scale(.97); } }
/* Modal de métodos de pago (ui/pay-method-modal.js): un botón grande por método. */
.v2-paypick { display: grid; gap: var(--sp-2); }
.v2-paypick__btn { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2); padding: var(--sp-4); }

/* ---------- Sheet lateral ---------- */
.v2-sheet-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(3,10,8,.5); opacity: 0; transition: opacity var(--t); }
.v2-sheet-overlay.is-in { opacity: 1; } .v2-sheet-overlay.is-out { opacity: 0; }
.v2-sheet { position: absolute; top: 0; bottom: 0; width: min(480px, 92vw); background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.v2-sheet--right { right: 0; transform: translateX(100%); transition: transform var(--t); }
.v2-sheet--right.is-in { transform: translateX(0); } .v2-sheet--right.is-out { transform: translateX(100%); }
.v2-sheet__head { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-5); border-bottom: 1px solid var(--border); }
.v2-sheet__title { font-size: var(--fs-md); }
.v2-sheet__body { padding: var(--sp-5); overflow-y: auto; flex: 1; }
.v2-sheet__foot { padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border); display: flex; gap: var(--sp-3); justify-content: flex-end; }

/* ---------- Tabs ---------- */
.v2-tabs__list { display: inline-flex; gap: 2px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-pill); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.v2-tabs__tab { padding: var(--sp-2) var(--sp-4); border-radius: var(--r-pill); font-weight: 700; font-size: var(--fs-sm); color: var(--muted); border: none; background: transparent; transition: var(--t-fast); }
.v2-tabs__tab[aria-selected="true"] { background: var(--brand-grad); color: var(--brand-contrast); }

/* ---------- Toasts ---------- */
.v2-toasts { position: fixed; right: var(--sp-4); bottom: var(--sp-4); z-index: 200; display: flex; flex-direction: column; gap: var(--sp-2); max-width: 380px; }
.v2-toast { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--surface-raised); border: 1px solid var(--border); box-shadow: var(--shadow); animation: v2slidein .2s ease; }
.v2-toast.is-out { animation: v2slidein .2s ease reverse; }
.v2-toast--success { border-left: 4px solid var(--success); }
.v2-toast--danger { border-left: 4px solid var(--danger); }
.v2-toast--warn { border-left: 4px solid var(--warning); }
.v2-toast--info { border-left: 4px solid var(--info); }
.v2-toast__msg { flex: 1; font-size: var(--fs-sm); }
.v2-toast__close { color: var(--muted); font-size: 18px; background: none; border: none; }
@keyframes v2slidein { from { opacity: 0; transform: translateX(20px); } }

/* ---------- Estados vacíos ---------- */
.v2-empty { text-align: center; padding: var(--sp-8) var(--sp-5); display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); }
.v2-empty__icon { font-size: 44px; }
.v2-empty__title { font-size: var(--fs-lg); }
.v2-empty__msg { max-width: 420px; }

/* Aviso datos demo */
.v2-demo-notice { display: inline-flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-4); border-radius: var(--r-pill); background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-size: var(--fs-xs); font-weight: 700; margin-bottom: var(--sp-4); }
.v2-demo-notice__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ---------- Hero / auth ---------- */
.v2-auth { min-height: 100%; display: grid; grid-template-columns: 1.1fr 1fr; }

/* Modo a sangre: las pantallas de login/registro llenan el área principal sin el padding
   ni el ancho máximo de .v2-main (que dejaban un marco en blanco alrededor). El router
   pone .v2-main--bleed según route.bleed. Cadena flex para llenar el alto exacto del main. */
.v2-main--bleed { padding: 0; display: flex; flex-direction: column; }
.v2-main--bleed .v2-container { max-width: none; flex: 1; display: flex; flex-direction: column; }
.v2-main--bleed .v2-auth { flex: 1; min-height: 0; }
.v2-main--bleed .v2-footer { display: none; }
@media (max-width: 880px) { .v2-auth { grid-template-columns: 1fr; } .v2-auth__aside { display: none; } }
.v2-auth__aside { background: var(--hero-grad); padding: var(--sp-10); display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--border); }
/* Variante sin aside (login): panel centrado a ancho completo, logo dentro de la tarjeta. */
.v2-auth--noaside { grid-template-columns: 1fr; }
/* Login social (OAuth): separador + botones de provider */
.v2-oauth-sep { display: flex; align-items: center; gap: 10px; margin: var(--sp-4) 0 var(--sp-3); color: var(--muted); font-size: var(--fs-sm); }
.v2-oauth-sep::before, .v2-oauth-sep::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.v2-oauth-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; margin-bottom: var(--sp-2); }
.v2-oauth-btn__ico { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; color: #fff; border-radius: 4px; font-weight: 700; }
.v2-auth__panel { display: grid; place-items: center; padding: var(--sp-6); }
.v2-auth__box { width: 100%; max-width: 420px; }
.v2-auth__logo { width: 64px; margin-bottom: var(--sp-5); }
.v2-auth__switch { text-align: center; margin-top: var(--sp-4); font-size: var(--fs-sm); color: var(--muted); }

/* ---------- Bracket de torneo (con conectores tipo llave) ----------
   Cada ronda tiene la mitad de partidos que la anterior; cada celda usa flex:1, así
   que el partido de la ronda siguiente queda centrado justo entre sus dos
   alimentadores. Los conectores se dibujan con ::before (tramo entrante) y ::after
   (codo: horizontal + vertical hasta el punto medio del par) sobre la celda. */
.v2-bracket {
  --bk-gap: var(--sp-8);
  --bk-line: color-mix(in srgb, var(--muted) 50%, transparent);
  display: flex; align-items: stretch; gap: var(--bk-gap);
  overflow-x: auto; padding: var(--sp-4) 0;
}
.v2-bracket__round { display: flex; flex-direction: column; flex: none; min-width: 300px; }
.v2-bracket__round-title { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-bottom: var(--sp-3); text-align: center; }
.v2-bracket__matches { flex: 1; display: flex; flex-direction: column; }
.v2-bracket__cell { flex: 1 1 0; position: relative; display: flex; flex-direction: column; justify-content: center; padding: var(--sp-2) 0; }

/* Tramo entrante (izquierda): del centro del hueco al borde del partido. Todas menos la 1.ª ronda. */
.v2-bracket__round:not(:first-child) .v2-bracket__cell::before {
  content: ""; position: absolute; top: 50%; right: 100%;
  width: calc(var(--bk-gap) / 2); height: 2px; margin-top: -1px;
  background: var(--bk-line);
}
/* Codo saliente (derecha): horizontal desde el partido + vertical hasta el punto medio del par. Todas menos la final. */
.v2-bracket__round:not(:last-child) .v2-bracket__cell::after {
  content: ""; position: absolute; left: 100%;
  width: calc(var(--bk-gap) / 2); height: 50%;
  border-right: 2px solid var(--bk-line);
}
.v2-bracket__round:not(:last-child) .v2-bracket__cell:nth-child(odd)::after { top: 50%; border-top: 2px solid var(--bk-line); }
.v2-bracket__round:not(:last-child) .v2-bracket__cell:nth-child(even)::after { bottom: 50%; border-bottom: 2px solid var(--bk-line); }

.v2-match { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.v2-match__row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sm); }
.v2-match__row + .v2-match__row { border-top: 1px solid var(--border); }
.v2-match__row.is-winner { color: var(--brand); font-weight: 700; background: color-mix(in srgb, var(--brand) 8%, transparent); }
.v2-match__side { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.v2-match__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Mini-marcador del partido: cabecera + una fila por pareja (Parejas · Resultado · sets) */
.v2-match__head, .v2-match__line { display: grid; align-items: center; gap: 6px; padding: 6px var(--sp-3); font-size: var(--fs-sm); }
.v2-match__head { background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 9px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; }
.v2-match__head > span { text-align: center; }
.v2-match__head > span:first-child { text-align: left; }
.v2-match__line + .v2-match__line { border-top: 1px solid var(--border); }
.v2-match__line.is-winner { color: var(--brand); font-weight: 700; background: color-mix(in srgb, var(--brand) 8%, transparent); }
.v2-match__res { text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.v2-match__g { text-align: center; font-variant-numeric: tabular-nums; color: var(--text-soft); }
.v2-match__line.is-winner .v2-match__res, .v2-match__line.is-winner .v2-match__g { color: var(--brand); }
/* Partido por el 3.er/4.º puesto: fuera de la llave (no encadena con nadie). */
.v2-bracket-extra { margin-top: var(--sp-5); }
.v2-bracket-extra .v2-match { max-width: 280px; }

/* ---------- Avatares de plazas (clases abiertas, vista pública) ----------
   Verde = plaza libre, rojo = ocupada. Las libres reservables (.v2-spot--join)
   muestran un «+» al pasar el ratón para apuntarse. */
.v2-spots { display: flex; gap: var(--sp-2); align-items: center; }
/* En la tarjeta de sesión, la fila de plazas ocupa el ancho y reparte los avatares. */
.v2-spots--band { justify-content: space-evenly; gap: var(--sp-3); margin-top: var(--sp-3); }
.v2-spot { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; transition: transform .12s ease, box-shadow .12s ease; }
.v2-spot svg { width: 27px; height: 27px; }
.v2-spot__icon { display: grid; place-items: center; }
.v2-spot--taken { background: #e5484d; }
.v2-spot--free { background: #16a34a; }
.v2-spot__plus { display: none; font-size: 28px; font-weight: 800; line-height: 1; }
.v2-spot--join { cursor: pointer; }
.v2-spot--join:hover { transform: scale(1.12); box-shadow: 0 6px 16px rgba(22, 163, 74, .45); }
.v2-spot--join:hover .v2-spot__icon { display: none; }
.v2-spot--join:hover .v2-spot__plus { display: block; }

/* ====================== Fase 2: vistas cliente ====================== */

/* Barra de navegación de fecha (reservas) */
.v2-datenav { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.v2-datenav__center { flex: 1; display: flex; align-items: center; gap: var(--sp-3); min-width: 160px; }

/* Rejilla de disponibilidad */
.v2-resgrid-wrap { overflow-x: auto; }
.v2-resgrid { width: 100%; border-collapse: separate; border-spacing: 6px; }
.v2-resgrid th { text-align: center; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: var(--sp-2); white-space: nowrap; }
.v2-resgrid__time { font-variant-numeric: tabular-nums; color: var(--text-soft); font-weight: 700; font-size: var(--fs-sm); white-space: nowrap; padding-right: var(--sp-2); }
.v2-slot { width: 100%; min-width: 92px; min-height: 52px; border-radius: var(--r-md); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: var(--fs-xs); border: 1px solid var(--border); }
.v2-slot.is-busy { background: var(--surface-2); color: var(--muted); }
.v2-slot.is-free { background: color-mix(in srgb, var(--brand) 12%, transparent); border-color: color-mix(in srgb, var(--brand) 35%, transparent); color: var(--brand); font-weight: 700; transition: var(--t-fast); cursor: pointer; }
.v2-slot.is-free:hover { background: var(--brand-grad); color: var(--brand-contrast); }
.v2-slot__free { font-weight: 800; }
.v2-slot__price { font-size: 10px; opacity: .85; }

/* Resumen de reserva en modal */
.v2-book-summary { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-4); background: var(--surface-2); border-radius: var(--r-md); border: 1px solid var(--border); }

/* Chat / mensajes */
.v2-chat { padding: 0; overflow: hidden; }
.v2-chat__grid { display: grid; grid-template-columns: 300px 1fr; min-height: 540px; }
.v2-chat__list { border-right: 1px solid var(--border); overflow-y: auto; max-height: 70vh; }
.v2-chat__conv { display: flex; gap: var(--sp-3); align-items: center; width: 100%; text-align: left; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); background: transparent; }
.v2-chat__conv:hover { background: var(--surface-2); }
.v2-chat__conv.is-active { background: color-mix(in srgb, var(--brand) 12%, transparent); }
.v2-chat__panel { display: flex; flex-direction: column; min-height: 540px; max-height: 70vh; }
.v2-chat__head { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4); border-bottom: 1px solid var(--border); }
.v2-chat__thread { flex: 1; overflow-y: auto; padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); }
.v2-msg { max-width: 75%; align-self: flex-start; }
.v2-msg.is-mine { align-self: flex-end; text-align: right; }
.v2-msg__bubble { padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); font-size: var(--fs-sm); display: inline-block; text-align: left; }
.v2-msg.is-mine .v2-msg__bubble { background: var(--brand-grad); color: var(--brand-contrast); border-color: transparent; }
.v2-msg__time { font-size: 10px; color: var(--muted); margin-top: 2px; }
.v2-chat__compose { display: flex; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--border); }
.v2-chat__compose .v2-input { flex: 1; }
@media (max-width: 760px) { .v2-chat__grid { grid-template-columns: 1fr; } .v2-chat__list { max-height: 220px; } }

/* ====================== Fase 3: competición ====================== */
/* Listas de ranking */
.v2-ranklist { display: flex; flex-direction: column; }
.v2-rank { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-2); border-bottom: 1px solid var(--border); cursor: pointer; transition: var(--t-fast); border-radius: var(--r-sm); }
.v2-rank:hover { background: var(--surface-2); }
.v2-rank:last-child { border-bottom: none; }
.v2-rank.is-me { background: color-mix(in srgb, var(--brand) 12%, transparent); }
.v2-rank__pos { width: 34px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; font-size: var(--fs-md); color: var(--text-soft); flex: none; }
.v2-rank__name { flex: 1; font-weight: 600; font-size: var(--fs-sm); }
.v2-rank__matches { flex: none; }
.v2-rank__elo { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--brand); min-width: 56px; text-align: right; }

/* Padel Slam campeones */
.v2-champ__team { display: flex; align-items: center; gap: var(--sp-3); }

/* Tournament cards hover */
.v2-tcard, .v2-quick, .v2-next { transition: var(--t-fast); }
.v2-tcard:hover { border-color: var(--brand); }
/* Tarjeta de torneo HORIZONTAL: miniatura del cartel a la izquierda, info a la derecha.
   Los carteles suelen ser verticales (A4): caja alta + object-fit:contain para verlos
   ENTEROS sin recortar (se centran con un pequeño margen si la proporción no encaja). */
.v2-tcard { display: flex; flex-direction: row; align-items: stretch; gap: 0; padding: 0; overflow: hidden; min-height: 184px; }
.v2-tcard__media { flex: 0 0 150px; align-self: stretch; position: relative; overflow: hidden; background: var(--surface-2); }
.v2-tcard__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.v2-tcard__media--empty { display: grid; place-items: center; }
.v2-tcard__body { flex: 1 1 auto; min-width: 0; padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); justify-content: center; }
/* Rejilla de torneos: 2 por fila en escritorio, 1 columna en móvil/tablet. */
.v2-tgrid { display: grid; grid-template-columns: 1fr; gap: var(--sp-4); }
@media (min-width: 961px) { .v2-tgrid { grid-template-columns: repeat(2, 1fr); } }

/* Detalle de torneo: cartel a la izquierda, cabecera + premios a la derecha (misma línea). */
.v2-tdetail__top { display: flex; gap: var(--sp-4); align-items: flex-start; flex-wrap: wrap; margin-bottom: var(--sp-4); }
.v2-tdetail__poster { flex: 0 0 auto; width: 220px; max-width: 100%; height: auto; max-height: 320px; object-fit: contain; border-radius: var(--r-md); box-shadow: var(--shadow-sm); display: block; }
.v2-tdetail__info { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.v2-tdetail__info > * { margin: 0; }

/* ====== Reservas v2: rejilla densa de 30 min + barra de fecha reordenada ====== */
.v2-datenav { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.v2-datenav__group { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.v2-datenav__label { font-size: var(--fs-md); min-width: 200px; }

.v2-resgrid { width: 100%; border-collapse: separate; border-spacing: 4px 2px; }
.v2-resgrid th { text-align: center; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: var(--sp-2); white-space: nowrap; }
.v2-resgrid__timehead { width: 52px; }
.v2-resgrid tr.is-hour td { border-top: 1px solid var(--border); }
.v2-resgrid__time { width: 52px; font-variant-numeric: tabular-nums; color: var(--text-soft); font-weight: 700; font-size: var(--fs-xs); text-align: right; padding-right: var(--sp-2); white-space: nowrap; }
.v2-resgrid__time.is-hour { color: var(--text); }
.v2-cellwrap { padding: 0; }
.v2-slot { width: 100%; min-width: 84px; min-height: 30px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 11px; border: 1px solid transparent; }
.v2-slot.is-busy { background: var(--surface-2); color: var(--muted); border-color: var(--border); padding: 0 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; justify-content: flex-start; }
.v2-slot.is-empty { background: transparent; border: 1px dashed color-mix(in srgb, var(--border) 70%, transparent); min-height: 30px; }
.v2-slot.is-free { background: color-mix(in srgb, var(--brand) 12%, transparent); border-color: color-mix(in srgb, var(--brand) 30%, transparent); color: var(--brand); font-weight: 700; cursor: pointer; transition: var(--t-fast); }
.v2-slot.is-free:hover { background: var(--brand-grad); color: var(--brand-contrast); }
.v2-slot__free { font-weight: 800; font-variant-numeric: tabular-nums; }
.v2-slot__price { font-size: 10px; opacity: .8; }
@media (max-width: 720px) { .v2-slot__price { display: none; } .v2-slot { min-width: 56px; } }

/* ====== Reservas v2: preselección por hover (la reserva completa = 3 franjas) ====== */
.v2-slot.is-avail { background: color-mix(in srgb, var(--brand) 5%, transparent); border-color: var(--border); color: var(--text-soft); }
.v2-slot.is-avail:not(.is-block) { cursor: pointer; }
.v2-slot.is-block { opacity: .5; }
.v2-slot__hint { display: none; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.v2-slot.is-preselect { background: var(--brand-grad); border-color: transparent; color: var(--brand-contrast); opacity: 1; box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--brand) 60%, transparent); }
.v2-slot.is-preselect-start .v2-slot__hint { display: inline-flex; }

/* ====================== Reservas v2: tablero admin (pistas × horas) ====================== */
.v2-resv-board { position: relative; display: grid; gap: 0; overflow-x: auto; }
.v2-resv-board__head { display: grid; position: sticky; top: 0; z-index: 3; background: var(--surface); }
.v2-resv-board__head > div { padding: var(--sp-2); text-align: center; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft); border-bottom: 1px solid var(--border); white-space: nowrap; }
.v2-resv-board__body { position: relative; display: grid; }
.v2-resv-timecol { display: grid; }
.v2-resv-timecol__cell { height: 30px; font-size: var(--fs-xs); color: var(--text-soft); text-align: right; padding-right: var(--sp-2); font-variant-numeric: tabular-nums; }
.v2-resv-timecol__cell.is-hour { color: var(--text); font-weight: 700; border-top: 1px solid var(--border); }
.v2-resv-col { position: relative; border-left: 1px solid var(--border); }
.v2-resv-cell { height: 30px; border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent); transition: background .1s; }
.v2-resv-cell.is-hour { border-top: 1px solid var(--border); }
.v2-resv-cell.is-free { cursor: pointer; }
.v2-resv-cell.is-free:hover { background: color-mix(in srgb, var(--brand) 14%, transparent); }
.v2-resv-cell.is-drop-target { background: color-mix(in srgb, var(--brand) 22%, transparent); box-shadow: inset 0 0 0 2px var(--brand); }
.v2-resv-cell.is-past { background: repeating-linear-gradient(45deg, transparent, transparent 6px, color-mix(in srgb, var(--border) 30%, transparent) 6px, color-mix(in srgb, var(--border) 30%, transparent) 12px); }
/* Fuera del horario de apertura del club: celda atenuada (cliente no reserva; admin sí, override). */
.v2-resv-cell.is-closed { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--muted) 6%, transparent) 0 6px, color-mix(in srgb, var(--muted) 15%, transparent) 6px 12px); }
/* Rayado de reserva ampliada / recargo por hueco (antes gradiente inline en board.js). */
.v2-resv-cell.is-striped { cursor: pointer; background: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(202, 138, 4, .22) 5px, rgba(202, 138, 4, .22) 10px); }
.v2-resv-cell.is-striped:hover { background: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(202, 138, 4, .34) 5px, rgba(202, 138, 4, .34) 10px); }
/* Etiqueta de claridad de celda libre (cliente): "Disponible" / "Con recargo". */
.v2-resv-cell__label { display: block; font-size: 9px; line-height: 29px; text-align: center; color: var(--muted); opacity: .65; pointer-events: none; user-select: none; letter-spacing: .02em; }
.v2-resv-cell.is-free:hover .v2-resv-cell__label { opacity: 1; color: var(--text); }
.v2-resv-cell.is-striped .v2-resv-cell__label { color: #b45309; opacity: .85; }

.v2-resv-chip { position: absolute; left: 2px; right: 2px; border-radius: var(--r-sm); padding: 3px 6px; font-size: 11px; line-height: 1.2; color: #fff; overflow: hidden; box-shadow: var(--shadow-sm); cursor: pointer; border: 1px solid transparent; z-index: 2; }
.v2-resv-chip__time { font-weight: 800; font-variant-numeric: tabular-nums; }
.v2-resv-chip__title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2-resv-chip__meta { opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
.v2-resv-chip[draggable="true"] { cursor: grab; }
.v2-resv-chip[draggable="true"]:active { cursor: grabbing; }
.v2-resv-chip.is-dragging { opacity: .45; }
.v2-resv-chip.is-cancelled { opacity: .45; text-decoration: line-through; }
.v2-resv-chip.is-locked { border-style: dashed; }
/* Partida abierta que NO ocupa la pista (incompleta): chip a MEDIA celda (mitad izquierda).
   La mitad derecha deja ver la celda "Disponible" de debajo, clicable para reservar encima. */
.v2-resv-chip.is-half { right: 50%; min-width: 46px; }
/* Reserva pagada del todo: anillo verde + chincheta ✓ en la esquina (solo admin). */
.v2-resv-chip.is-paid { box-shadow: var(--shadow-sm), inset 0 0 0 2px rgba(34, 197, 94, .95); }
.v2-resv-chip__paid {
  position: absolute; top: 2px; right: 2px; z-index: 3; pointer-events: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: #22c55e; color: #fff;
  display: grid; place-items: center;
  font-size: 9px; font-weight: 900; line-height: 1;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .9);
}

/* Colores por tipo de reserva */
.v2-resv-chip--reserva         { background: rgba(239, 83, 80, 0.9); }
.v2-resv-chip--partido         { background: rgba(124, 92, 255, 0.9); }
.v2-resv-chip--clase           { background: rgba(255, 167, 38, 0.92); }
.v2-resv-chip--clase-pendiente { background: rgba(255, 193, 7, 0.92); color: #1a1205; }
.v2-resv-chip--escuela         { background: rgba(156, 204, 101, 0.92); color: #14210a; }
.v2-resv-chip--campeonato      { background: rgba(171, 71, 188, 0.92); }
.v2-resv-chip--reserva-centro  { background: rgba(121, 134, 203, 0.92); }
.v2-resv-chip--puerta-abierta  { background: rgba(77, 182, 172, 0.92); }
.v2-resv-chip--actividad       { background: rgba(120, 144, 156, 0.92); }
.v2-resv-chip--bloqueado       { background: rgba(84, 110, 122, 0.92); }
.v2-resv-chip--programa        { background: rgba(38, 198, 218, 0.92); color: #052327; }
.v2-resv-chip--tratamiento     { background: rgba(255, 112, 67, 0.92); }
.v2-resv-chip--torneo          { background: rgba(66, 165, 245, 0.92); }
.v2-resv-chip--bloque-fijo     { background: rgba(189, 189, 189, 0.9); color: #1c1c1c; }

/* Leyenda de colores */
.v2-resv-legend { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-2); }
.v2-resv-legend__item { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-soft); }
.v2-resv-legend__dot { width: 12px; height: 12px; border-radius: 4px; }

/* Ocupado en la grid del CLIENTE: colorear por tipo. Especificidad doble (.v2-slot.is-busy)
   para ganar al fondo gris base; se repite el color de fondo de cada tipo. */
.v2-slot.is-busy.v2-resv-chip--reserva         { background: rgba(239, 83, 80, 0.9); color: #fff; border-color: transparent; }
.v2-slot.is-busy.v2-resv-chip--partido         { background: rgba(124, 92, 255, 0.9); color: #fff; border-color: transparent; }
.v2-slot.is-busy.v2-resv-chip--clase           { background: rgba(255, 167, 38, 0.92); color: #fff; border-color: transparent; }
.v2-slot.is-busy.v2-resv-chip--clase-pendiente { background: rgba(255, 193, 7, 0.92); color: #1a1205; border-color: transparent; }
.v2-slot.is-busy.v2-resv-chip--escuela         { background: rgba(156, 204, 101, 0.92); color: #14210a; border-color: transparent; }
.v2-slot.is-busy.v2-resv-chip--campeonato      { background: rgba(171, 71, 188, 0.92); color: #fff; border-color: transparent; }
.v2-slot.is-busy.v2-resv-chip--reserva-centro  { background: rgba(121, 134, 203, 0.92); color: #fff; border-color: transparent; }
.v2-slot.is-busy.v2-resv-chip--puerta-abierta  { background: rgba(77, 182, 172, 0.92); color: #fff; border-color: transparent; }
.v2-slot.is-busy.v2-resv-chip--actividad       { background: rgba(120, 144, 156, 0.92); color: #fff; border-color: transparent; }
.v2-slot.is-busy.v2-resv-chip--bloqueado       { background: rgba(84, 110, 122, 0.92); color: #fff; border-color: transparent; }
.v2-slot.is-busy.v2-resv-chip--programa        { background: rgba(38, 198, 218, 0.92); color: #052327; border-color: transparent; }
.v2-slot.is-busy.v2-resv-chip--tratamiento     { background: rgba(255, 112, 67, 0.92); color: #fff; border-color: transparent; }
.v2-slot.is-busy.v2-resv-chip--torneo          { background: rgba(66, 165, 245, 0.92); color: #fff; border-color: transparent; }
.v2-slot.is-busy.v2-resv-chip--bloque-fijo     { background: rgba(189, 189, 189, 0.9); color: #1c1c1c; border-color: transparent; }

/* ====== Formulario de reserva: autocompletado, chips de jugadores, util ====== */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.justify-end { justify-content: flex-end; }
.v2-ac-wrap { position: relative; }
.v2-ac { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: var(--surface-raised, var(--surface)); border: 1px solid var(--border); border-radius: var(--r-sm); box-shadow: var(--shadow-md, var(--shadow-sm)); max-height: 220px; overflow-y: auto; }
.v2-ac:empty { display: none; }
.v2-ac__item { display: block; width: 100%; text-align: left; background: none; border: none; padding: 8px 10px; cursor: pointer; font-size: var(--fs-sm); color: var(--text); }
.v2-ac__item:hover { background: color-mix(in srgb, var(--brand) 12%, transparent); }
.v2-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.v2-chip-rm { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 3px 6px 3px 10px; font-size: var(--fs-sm); }
.v2-chip-rm__x { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 15px; line-height: 1; }
.v2-tag-dot { display: inline-block; padding: 2px 8px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; color: #fff; }
.v2-tag-dot.v2-resv-chip--clase-pendiente, .v2-tag-dot.v2-resv-chip--escuela, .v2-tag-dot.v2-resv-chip--programa, .v2-tag-dot.v2-resv-chip--bloque-fijo { color: #1a1205; }

/* ====================== Torneos: drag & drop de grupos + slots ====================== */
/* Hub de clases (#/clases): selector de las 3 secciones como tarjetas grandes */
.v2-hubtabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); margin-bottom: var(--sp-4); }
.v2-hubtab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: var(--sp-3) var(--sp-2); cursor: pointer; text-align: center;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  transition: border-color var(--t-fast, .15s), background var(--t-fast, .15s), box-shadow var(--t-fast, .15s);
}
.v2-hubtab:hover { border-color: var(--border-strong, var(--brand)); }
.v2-hubtab.is-active {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  box-shadow: inset 0 -3px 0 var(--brand);
}
.v2-hubtab__icon { font-size: 24px; line-height: 1.2; }
.v2-hubtab__title { font-weight: 700; }
.v2-hubtab.is-active .v2-hubtab__title { color: var(--brand); }
.v2-hubtab__desc { font-size: var(--fs-sm); color: var(--text-muted); }
@media (max-width: 560px) {
  .v2-hubtab__desc { display: none; }
  .v2-hubtab { padding: var(--sp-2); }
  .v2-hubtab__icon { font-size: 20px; }
}

/* Heatmap de disponibilidad de grupo (inscripciones escuela): celda = nº de miembros disponibles */
.v2-heatmap { border-collapse: collapse; font-size: var(--fs-sm); min-width: 320px; }
.v2-heatmap th { padding: 4px 6px; color: var(--text-muted); font-weight: 600; text-align: center; }
.v2-heatmap tbody th { text-align: right; font-variant-numeric: tabular-nums; }
.v2-heatcell { width: 34px; height: 26px; text-align: center; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; font-variant-numeric: tabular-nums; }
.v2-heatcell.is-full { color: #fff; font-weight: 700; }

.v2-dnd-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--sp-3); }
.v2-dnd-col { background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--r-md); padding: var(--sp-2); min-height: 90px; transition: border-color .15s, background .15s; }
.v2-dnd-col.is-drop-target { border-color: var(--brand); border-style: solid; background: color-mix(in srgb, var(--brand) 10%, transparent); }
.v2-dnd-col__head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: var(--fs-sm); margin-bottom: var(--sp-2); }
.v2-dnd-col__del { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 16px; line-height: 1; }
.v2-dnd-col__body { display: flex; flex-direction: column; gap: var(--sp-1); min-height: 24px; }
.v2-dnd-chip { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 6px 10px; font-size: var(--fs-sm); cursor: grab; user-select: none; }
.v2-dnd-chip[draggable="true"]:active { cursor: grabbing; }
.v2-dnd-chip.is-dragging { opacity: .5; }

.v2-slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--sp-2); }
.v2-slot { border: 1px solid var(--border); border-radius: var(--r-sm); padding: var(--sp-2); }
.v2-slot--blocked { border-color: var(--warning); }
.v2-slot--assigned { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent); }
.v2-slot--released { opacity: .55; }
.v2-slot-pick { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.v2-slot-pick__item { border: 1px solid var(--border); border-radius: var(--r-pill); padding: 6px 12px; font-size: var(--fs-sm); cursor: pointer; user-select: none; }
.v2-slot-pick__item.is-selected { background: color-mix(in srgb, var(--brand) 18%, transparent); border-color: var(--brand); color: var(--brand); font-weight: 700; }

.v2-weekdays { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.v2-weekday { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 6px 10px; cursor: pointer; user-select: none; font-size: var(--fs-sm); }
.v2-weekday:has(input:checked) { background: color-mix(in srgb, var(--brand) 16%, transparent); border-color: var(--brand); color: var(--brand); font-weight: 700; }
.v2-weekday:has(input:disabled) { opacity: .5; cursor: default; }
.v2-weekday input { accent-color: var(--brand); }

/* ====================== Padel Slam: fichas, cola, normativa ====================== */
/* Rejilla de campeones: mobile-first (1 col que llena el ancho). En pantallas grandes
   las fichas se acotan a un ancho cómodo y se centran, en vez de estirarse a media
   pantalla y dejar el contenido diminuto rodeado de blanco. */
.v2-slam-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-4); }
@media (min-width: 561px) { .v2-slam-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 961px) { .v2-slam-grid { grid-template-columns: repeat(3, 1fr); } } /* 3 campeones por fila */
.v2-slam-card { display: flex; flex-direction: column; gap: var(--sp-3); }
.v2-slam-card.is-vacant { opacity: .92; }
.v2-slam-throne { font-size: 40px; text-align: center; }
.v2-slam-duo { position: relative; display: flex; justify-content: center; align-items: center; gap: 0; margin: var(--sp-2) 0; min-height: 64px; }
.v2-slam-ava { width: 60px; height: 60px; border-radius: 50%; background-size: cover; background-position: center; border: 3px solid var(--surface); box-shadow: var(--shadow-sm); display: grid; place-items: center; }
.v2-slam-ava--ini { background: var(--brand-grad); color: var(--brand-contrast); font-weight: 800; }
.v2-slam-ava--a { margin-right: -14px; z-index: 2; }
.v2-slam-ava--b { margin-left: -14px; }
.v2-slam-ava--sm { width: 34px; height: 34px; border-width: 2px; font-size: 12px; }
.v2-slam-duo__badge { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); background: var(--gold); color: #1a1205; font-weight: 800; font-size: 11px; padding: 2px 10px; border-radius: var(--r-pill); white-space: nowrap; }
.v2-slam-card__team { font-size: var(--fs-md); margin-top: var(--sp-2); }
.v2-slam-stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--text-soft); margin-top: var(--sp-2); }
.v2-slam-stats code { background: var(--surface-2); padding: 1px 6px; border-radius: var(--r-sm); color: var(--brand); font-weight: 700; }
.v2-slam-ava--sm.v2-slam-ava--b { margin-left: -10px; }

/* ---------- Cuadrícula semanal del Slam (ui/week-grid.js) ----------
   Verde = disponible/elegible · rojo = bloqueado · gris = sin pista · brand = elegida.
   El verde #16a34a es el mismo que usa la disponibilidad de liga (legible en claro y oscuro). */
.v2-wgrid { border-collapse: collapse; width: 100%; }
.v2-wgrid th, .v2-wgrid td { border: 1px solid var(--border); padding: 4px 6px; text-align: center; font-size: var(--fs-xs); }
.v2-wgrid th { font-weight: 700; white-space: nowrap; }
.v2-wgrid__time { position: sticky; left: 0; z-index: 1; background: var(--surface); font-weight: 700; white-space: nowrap; }
.v2-wgrid__cell { min-width: 40px; height: 38px; cursor: pointer; user-select: none; color: #fff; font-weight: 700; }
.v2-wgrid__cell.is-free { background: #16a34a; }
.v2-wgrid__cell.is-blocked { background: var(--danger); }
.v2-wgrid__cell.is-locked { background: color-mix(in srgb, var(--danger) 60%, #000 40%); cursor: not-allowed; font-size: 13px; box-shadow: inset 0 0 0 2px color-mix(in srgb, #000 28%, transparent); }
.v2-wgrid__cell.is-off { background: var(--surface-2); opacity: .35; cursor: default; }
.v2-wgrid__cell.is-picked { background: var(--brand); color: var(--brand-contrast); box-shadow: inset 0 0 0 2px var(--surface), inset 0 0 0 4px var(--brand); }
.v2-wgrid.is-disabled .v2-wgrid__cell { cursor: default; opacity: .6; }
.v2-wgrid-legend { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; font-size: var(--fs-xs); color: var(--text-soft); margin-top: var(--sp-2); }
.v2-wgrid-legend__dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.v2-wgrid-legend__dot.is-free { background: #16a34a; }
.v2-wgrid-legend__dot.is-blocked { background: var(--danger); }
.v2-wgrid-legend__dot.is-locked { background: color-mix(in srgb, var(--danger) 60%, #000 40%); box-shadow: inset 0 0 0 2px color-mix(in srgb, #000 28%, transparent); }
.v2-wgrid-legend__dot.is-off { background: var(--surface-2); border: 1px solid var(--border); }
.v2-wgrid-legend__dot.is-picked { background: var(--brand); }

/* ---------- Avatar genérico (parejas en clasificaciones de liga, grupos y cuadro) ---------- */
.v2-ava { width: 32px; height: 32px; border-radius: 50%; background-size: cover; background-position: center; background-color: var(--surface-2); border: 2px solid var(--surface); box-shadow: var(--shadow-sm); display: grid; place-items: center; flex: none; overflow: hidden; }
.v2-ava--ini { background: var(--brand-grad); color: var(--brand-contrast); font-weight: 800; font-size: 11px; }
.v2-ava--sm { width: 28px; height: 28px; }
.v2-ava--sm.v2-ava--ini { font-size: 10px; }
.v2-ava--xs { width: 24px; height: 24px; }
.v2-ava--xs.v2-ava--ini { font-size: 9px; }
.v2-ava-pair { display: inline-flex; align-items: center; flex: none; }
.v2-ava-pair > .v2-ava + .v2-ava { margin-left: -9px; }
/* Pareja como lista de jugadores: avatar + nombre, apilados (clasificación de liga) */
.v2-pair-players { display: flex; flex-direction: column; gap: 6px; }
.v2-pair-player { display: flex; align-items: center; gap: var(--sp-2); }
.v2-pair-player__name { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }

/* Escalado del contenido de la ficha de campeón en pantallas grandes para que los
   elementos sean proporcionales al tamaño de la tarjeta (no diminutos). */
@media (min-width: 561px) {
  .v2-slam-card { gap: var(--sp-4); }
  .v2-slam-card .v2-slam-duo { min-height: 84px; }
  .v2-slam-card .v2-slam-ava { width: 78px; height: 78px; border-width: 4px; font-size: var(--fs-md); }
  .v2-slam-card .v2-slam-ava--a { margin-right: -18px; }
  .v2-slam-card .v2-slam-ava--b { margin-left: -18px; }
  .v2-slam-card .v2-slam-card__team { font-size: var(--fs-lg); }
  .v2-slam-card .v2-badge { font-size: var(--fs-sm); padding: 4px 14px; }
  .v2-slam-card .v2-slam-stats { font-size: var(--fs-sm); gap: var(--sp-3); }
  .v2-slam-card .v2-slam-throne { font-size: 56px; }
}

/* Normativa (prosa) */
.v2-prose { line-height: 1.7; color: var(--text-soft); max-width: 80ch; }
.v2-prose h2 { font-size: var(--fs-xl); color: var(--text); margin: var(--sp-4) 0 var(--sp-3); }
.v2-prose h3 { font-size: var(--fs-md); color: var(--text); margin: var(--sp-5) 0 var(--sp-2); }
.v2-prose p { margin-bottom: var(--sp-3); }
.v2-prose ul, .v2-prose ol { margin: 0 0 var(--sp-3) var(--sp-5); display: flex; flex-direction: column; gap: 4px; }
.v2-prose li { margin-left: var(--sp-2); }
.v2-prose b { color: var(--text); }
.v2-prose code { background: var(--surface-2); padding: 1px 6px; border-radius: var(--r-sm); color: var(--brand); }
.v2-prose table { width: 100%; border-collapse: collapse; margin: var(--sp-3) 0; }
.v2-prose th, .v2-prose td { border: 1px solid var(--border); padding: var(--sp-2) var(--sp-3); text-align: left; }

/* ====================== Torneos: pills de categoría + lista de definiciones ====================== */
.v2-catpills { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.v2-catpill { display: inline-flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-4); border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-soft); font-weight: 700; font-size: var(--fs-sm); transition: var(--t-fast); }
.v2-catpill:hover { border-color: var(--brand); color: var(--brand); }
.v2-catpill.is-active { background: var(--brand-grad); color: var(--brand-contrast); border-color: transparent; }
.v2-catpill__n { background: color-mix(in srgb, var(--text) 12%, transparent); border-radius: var(--r-pill); padding: 0 7px; font-size: var(--fs-xs); }
.v2-catpill.is-active .v2-catpill__n { background: rgba(255,255,255,.25); }
.v2-deflist { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2) var(--sp-5); }
@media (max-width: 560px) { .v2-deflist { grid-template-columns: 1fr; } }
.v2-deflist__row { display: flex; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }

/* ====================== Admin: mini-gráfico de barras ====================== */
.v2-bars { display: flex; align-items: flex-end; gap: var(--sp-2); height: 160px; padding-top: var(--sp-2); }
.v2-bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); height: 100%; justify-content: flex-end; }
.v2-bars__bar { width: 70%; min-height: 4px; background: var(--brand-grad); border-radius: var(--r-sm) var(--r-sm) 0 0; transition: var(--t); }
.v2-bars__col:hover .v2-bars__bar { filter: brightness(1.15); }
.v2-bars__lbl { font-size: 10px; color: var(--muted); white-space: nowrap; }

/* ====================== Admin: tokens, scopes, variables de email ====================== */
.v2-token { font-family: var(--font-mono); font-size: var(--fs-sm); background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); word-break: break-all; cursor: pointer; }
.v2-token:hover { border-color: var(--brand); }
.v2-scopegrid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
@media (max-width: 560px) { .v2-scopegrid { grid-template-columns: 1fr; } }
.v2-vars { border-top: 1px solid var(--border); padding-top: var(--sp-4); }
.v2-varchip { font-family: var(--font-mono); font-size: var(--fs-xs); padding: 2px 8px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--accent); cursor: pointer; }
.v2-varchip:hover { border-color: var(--accent); }

/* ====================== Flujos de jugador ====================== */
.v2-myresv { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.v2-myresv:last-child { border-bottom: none; }

/* ====== Reservas: barra de fecha en una sola línea (fecha = botón que abre el selector) ====== */
.v2-datenav { flex-wrap: nowrap; }
.v2-datenav__group { flex: 1; min-width: 0; }
.v2-datenav__label { min-width: 0; cursor: pointer; background: transparent; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: var(--r-sm); padding: var(--sp-1) var(--sp-2); }
.v2-datenav__label:hover { color: var(--brand); }
.v2-datenav__date { max-width: 170px; }
@media (max-width: 720px) {
  .v2-datenav__group { gap: var(--sp-1); }
  .v2-datenav__label { flex: 1; text-align: center; font-size: var(--fs-base); }
  .v2-datenav__date { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; padding: 0; border: 0; }
  .v2-datenav .v2-iconbtn { width: 36px; height: 36px; flex: none; }
}

/* ====================== Ranking: podio, categorías, barra de ELO, sparkline ====================== */
.v2-rk-ava { width: 40px; height: 40px; border-radius: 50%; background-size: cover; background-position: center; flex: none; display: grid; place-items: center; background-color: var(--surface-2); }
.v2-rk-ava--ini { background: var(--brand-grad); color: var(--brand-contrast); font-weight: 800; }
.v2-rk-ava--sm { width: 34px; height: 34px; font-size: 12px; }
.v2-rk-ava--lg { width: 56px; height: 56px; font-size: var(--fs-md); }

/* Podio */
.v2-podium-card { background: var(--hero-grad); }
.v2-podium { display: flex; align-items: flex-end; justify-content: center; gap: var(--sp-4); padding: var(--sp-3) 0 0; width: 100%; }
.v2-podium__item { flex: 1 1 0; min-width: 0; max-width: 200px; display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); background: transparent; cursor: pointer; }
.v2-podium__medal { font-size: 28px; }
.v2-podium__ava { width: 56px; height: 56px; border: 3px solid var(--surface); box-shadow: var(--shadow); }
.v2-podium__item--1 .v2-podium__ava { width: 76px; height: 76px; border-color: var(--gold); }
.v2-podium__name { font-weight: 700; font-size: var(--fs-sm); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.v2-podium__elo { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-lg); color: var(--brand); }
.v2-podium__bar { width: 100%; border-radius: var(--r-md) var(--r-md) 0 0; display: grid; place-items: center; color: var(--brand-contrast); font-weight: 800; margin-top: var(--sp-2); }
.v2-podium__item--1 .v2-podium__bar { height: 90px; background: linear-gradient(180deg, var(--gold), color-mix(in srgb, var(--gold) 60%, transparent)); }
.v2-podium__item--2 .v2-podium__bar { height: 64px; background: linear-gradient(180deg, #c8d2dd, #9aa7b3); }
.v2-podium__item--3 .v2-podium__bar { height: 46px; background: linear-gradient(180deg, #d8a06a, #b67b44); }
.v2-podium .v2-badge { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) {
  .v2-podium { gap: 6px; }
  .v2-podium__item { max-width: 33.333%; }
  .v2-podium__medal { font-size: 22px; }
  .v2-podium__item--1 .v2-podium__ava { width: 60px; height: 60px; }
  .v2-podium__ava { width: 44px; height: 44px; }
  .v2-podium__elo { font-size: var(--fs-md); }
  .v2-podium__name { font-size: var(--fs-xs); }
  .v2-podium__bar { font-size: var(--fs-sm); }
}

/* Fila con barra de ELO */
.v2-rank__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.v2-rank__main .v2-rank__name { flex: none; }
.v2-rank__bar { height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.v2-rank__bar-fill { display: block; height: 100%; background: var(--brand-grad); border-radius: 999px; }

/* Perfil */
.v2-rk-bigelo { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-2xl); color: var(--brand); font-variant-numeric: tabular-nums; }
.v2-rk-spark { width: 100%; height: 70px; display: block; }

/* Historial de partidos (modal de perfil del ranking): filas clicables con resultado exacto. */
.v2-rk-match { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 9px 6px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: inherit; text-align: left; cursor: pointer; border-radius: var(--r-sm); transition: background .15s ease; }
.v2-rk-match:last-child { border-bottom: 0; }
.v2-rk-match.is-static { cursor: default; }
.v2-rk-match:not(.is-static):hover { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.v2-rk-match__main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.v2-rk-match__title { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2-rk-match__sub { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2-rk-match__right { display: flex; align-items: center; gap: 8px; flex: none; }
.v2-rk-match__score { font-variant-numeric: tabular-nums; font-size: var(--fs-xs); color: var(--text-soft); font-weight: 700; }
.v2-rk-match__chev { color: var(--muted); font-size: 20px; line-height: 1; flex: none; }

/* ====================== TPV / POS del bar ====================== */
.v2-pos-layout { display: grid; grid-template-columns: 1fr 360px; gap: var(--sp-4); align-items: start; }
@media (max-width: 860px) { .v2-pos-layout { grid-template-columns: 1fr; } }
.v2-pos-cats { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.v2-pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--sp-2); }
.v2-pos-prod { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-2); cursor: pointer; transition: var(--t-fast); min-height: 58px; }
.v2-pos-prod:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.v2-pos-prod__name { font-weight: 700; font-size: var(--fs-sm); line-height: 1.15; }
.v2-pos-prod__price { color: var(--brand); font-weight: 800; font-variant-numeric: tabular-nums; }
.v2-pos-prod__stock { font-size: var(--fs-xs); color: var(--text-soft); }
.v2-pos-cart__head { font-size: var(--fs-md); margin-bottom: var(--sp-2); }
.v2-pos-cart__lines { display: flex; flex-direction: column; gap: 4px; max-height: 46vh; overflow-y: auto; }
.v2-pos-line { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: var(--sp-2); padding: 4px 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.v2-pos-line__name { font-size: var(--fs-sm); }
.v2-pos-line__qty { display: inline-flex; align-items: center; gap: 6px; }
.v2-pos-line__n { min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.v2-pos-line__sub { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 56px; text-align: right; }
.v2-pos-line__rm { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 16px; line-height: 1; }
.v2-pos-cart__total { margin-top: var(--sp-3); padding-top: var(--sp-2); border-top: 1px solid var(--border); }
.v2-pos-pay { width: 100%; margin-top: var(--sp-3); }

/* TPV — navegación por familias/subfamilias */
.v2-pos-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.v2-pos-crumb { background: none; border: none; color: var(--text-soft); font-weight: 700; font-size: var(--fs-sm); cursor: pointer; padding: 2px 4px; border-radius: var(--r-sm); }
.v2-pos-crumb:hover { color: var(--brand); }
.v2-pos-crumb.is-active { color: var(--text); }
.v2-pos-crumb__sep { color: var(--muted); }
.v2-pos-folder { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left; background: color-mix(in srgb, var(--brand) 8%, var(--surface-2)); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-2); cursor: pointer; transition: var(--t-fast); min-height: 58px; }
.v2-pos-folder:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 16%, transparent); }
.v2-pos-folder__ico { font-size: 18px; line-height: 1; }
.v2-pos-folder__name { font-weight: 700; font-size: var(--fs-sm); line-height: 1.15; }
.v2-pos-folder__n { font-size: var(--fs-xs); color: var(--text-soft); }

/* ═══════════════════════════════════════════════════════════════════════════
   TPV / POS — disposición tipo workbench (ticket + navegador de catálogo +
   lateral de cobro), estilizada con los tokens de diseño V2.
   ═══════════════════════════════════════════════════════════════════════════ */
.small { font-size: var(--fs-sm); line-height: 1.3; }
.items-end { align-items: flex-end; }
.v2-warn { color: var(--warning); }
.v2-alert { border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--r-md); padding: 12px 14px; }
.v2-alert--ok { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); background: color-mix(in srgb, var(--brand) 12%, var(--surface)); }
.admin-pos-h { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-md); color: var(--text); }

/* POS: cabecera compacta para que el workbench gane alto (más contenido a la vista). */
.v2-pagehead:has(+ .admin-pos-workbench) { margin-bottom: var(--sp-3); }
.admin-pos-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--sp-4);
  height: calc(100vh - 168px);
  min-height: 520px;
  align-items: stretch;
}
.admin-pos-workbench > * { min-height: 0; }
.admin-pos-main, .admin-pos-side { min-width: 0; min-height: 0; height: 100%; display: grid; gap: var(--sp-4); }
.admin-pos-main { grid-template-rows: minmax(0, 56%) minmax(0, 44%); }
.admin-pos-side { grid-template-rows: auto auto minmax(140px, 1fr); }

/* Las secciones llevan .v2-card (fondo/borde/sombra) + estos grids internos.
   .v2-card no trae padding propio → se lo damos aquí para que el contenido no
   quede pegado al borde de la tarjeta (box-sizing:border-box, no rompe el alto fijo). */
.admin-pos-ticket, .admin-pos-browser, .admin-pos-side__card {
  min-height: 0; height: 100%; overflow: hidden; display: grid; gap: var(--sp-3);
  padding: var(--sp-4);
}
.admin-pos-ticket { grid-template-rows: auto minmax(0, 1fr); }
.admin-pos-browser { grid-template-rows: auto auto minmax(0, 1fr); gap: var(--sp-2); }

.admin-pos-ticket__topbar, .admin-pos-browser__topbar, .admin-pos-side__header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3);
}
.admin-pos-ticket__total-chip, .admin-pos-side__grand-total {
  padding: 8px 14px; border-radius: var(--r-pill); background: var(--brand-grad); color: var(--brand-contrast);
  font-family: var(--font-display); font-weight: 800; white-space: nowrap;
}
.admin-pos-side__grand-total { font-size: var(--fs-lg); }

/* Ticket: tabla con cabecera fija + cuerpo scrollable */
.admin-pos-ticket__table { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.admin-pos-ticket__head, .admin-pos-ticket__row {
  display: grid; grid-template-columns: 92px minmax(0,1fr) 84px 70px auto; gap: var(--sp-2); align-items: center;
}
/* Precio unitario editable en la línea del ticket (input compacto, números tabulares). */
.admin-pos-ticket__price-input {
  width: 100%; padding: 4px 6px; font-size: var(--fs-sm); text-align: right;
  font-variant-numeric: tabular-nums;
}
.admin-pos-ticket__head { padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: var(--fs-xs); color: var(--text-soft); text-transform: uppercase; letter-spacing: .04em; }
.admin-pos-ticket__body { overflow-y: auto; min-height: 0; }
.admin-pos-ticket__row { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.admin-pos-ticket__empty { padding: 18px 12px; color: var(--text-soft); font-size: var(--fs-sm); }
.admin-pos-ticket__qty { display: flex; align-items: center; gap: 6px; }
.admin-pos-ticket__desc strong { display: block; font-weight: 700; }
.admin-pos-ticket__desc span { font-size: var(--fs-xs); color: var(--text-soft); }
.admin-pos-ticket__price, .admin-pos-ticket__line-total { font-variant-numeric: tabular-nums; }
.admin-pos-ticket__line-total { font-weight: 800; }
.admin-pos-stepper { width: 26px; height: 26px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-weight: 800; cursor: pointer; line-height: 1; }
.admin-pos-stepper:hover { border-color: var(--brand); }

/* Navegador */
.admin-pos-browser__toolbar { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.admin-pos-breadcrumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.admin-pos-breadcrumb { font-size: var(--fs-xs); padding: 3px 9px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--border); }
.admin-pos-breadcrumb--muted { color: var(--text-soft); }
.admin-pos-browser__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: var(--sp-2); overflow-y: auto; min-height: 0; align-content: start; padding: 2px; }
.admin-pos-browser__empty { color: var(--text-soft); font-size: var(--fs-sm); padding: 12px; }
.admin-pos-browser-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 10px 8px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); cursor: pointer; transition: border-color .12s, transform .06s;
}
.admin-pos-browser-tile:hover { border-color: var(--brand); }
.admin-pos-browser-tile:active { transform: scale(.98); }
.admin-pos-browser-tile strong { font-weight: 700; font-size: var(--fs-sm); line-height: 1.15; }
.admin-pos-browser-tile span { font-size: var(--fs-xs); color: var(--text-soft); }
.admin-pos-browser-tile__media { width: 100%; display: flex; justify-content: center; }
.admin-pos-browser-tile__media img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--r-md); }
.admin-pos-browser-tile__thumb--placeholder { width: 56px; height: 56px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--brand-grad); color: var(--brand-contrast); font-family: var(--font-display); font-weight: 800; }
.admin-pos-browser-tile--product { background: var(--surface-raised, var(--surface-2)); }
.admin-pos-browser-tile--product strong { color: var(--brand); }

/* Lateral */
.admin-pos-side__card { grid-template-rows: auto auto 1fr; align-content: start; }
.admin-pos-side__card--summary { grid-template-rows: none; }
.admin-pos-side__actions { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-2); }
.admin-pos-side__actions .btn--brand { width: 100%; }
.admin-pos-side__searchrow { display: flex; gap: var(--sp-2); }
.admin-pos-selected { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-2); }
.admin-pos-search-results { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; min-height: 0; max-height: 220px; }
.admin-pos-search-item { text-align: left; padding: 8px 10px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; }
.admin-pos-search-item:hover { border-color: var(--brand); }
.admin-pos-search-item strong { display: block; font-weight: 700; }
.admin-pos-search-item span { font-size: var(--fs-xs); color: var(--text-soft); }
.admin-pos-recent-sales { display: flex; flex-direction: column; gap: var(--sp-2); overflow-y: auto; min-height: 0; }
.admin-pos-recent-sale { border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px; background: var(--surface-2); }
.admin-pos-recent-sale__top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); font-weight: 700; }

@media (max-width: 980px) {
  .admin-pos-workbench { grid-template-columns: 1fr; height: auto; }
  .admin-pos-main, .admin-pos-side { grid-template-rows: none; height: auto; }
  .admin-pos-ticket, .admin-pos-browser, .admin-pos-side__card { height: auto; }
  .admin-pos-ticket__body, .admin-pos-browser__grid { max-height: 46vh; }
}

/* Pantallas de poco alto (tablet horizontal, portátiles pequeños): mantenemos las 2
   columnas pero el workbench deja de tener alto fijo y la página hace scroll, de modo
   que la tarjeta de Cobro y su botón «Cobrar» nunca queden cortados ni inaccesibles. */
@media (min-width: 981px) and (max-height: 860px) {
  .admin-pos-workbench { height: auto; min-height: 0; }
  .admin-pos-main, .admin-pos-side { grid-template-rows: none; height: auto; }
  .admin-pos-ticket, .admin-pos-browser, .admin-pos-side__card { height: auto; }
  .admin-pos-ticket__body, .admin-pos-browser__grid { max-height: 42vh; }
}

/* Selección por arrastre en el tablero de reservas (admin): varias franjas / pistas */
.v2-resv-board { user-select: none; }
.v2-resv-cell.is-selecting { background: color-mix(in srgb, var(--brand) 26%, transparent); box-shadow: inset 0 0 0 1px var(--brand); }
.v2-resv-cell.is-free { cursor: cell; }

/* Detalle de reserva (visualización portada de MatchPoint) */
.v2-rd-head { margin-bottom: var(--sp-2); }
.v2-rd-head__title { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-lg); }
.v2-rd-summary { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-4); align-items: center; padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.v2-rd-summary__pay { margin-left: auto; display: flex; gap: var(--sp-2); align-items: center; }
.v2-rd-cards { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-3); }
.v2-rd-card { display: flex; gap: var(--sp-3); align-items: center; padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.v2-rd-card__avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-grad); color: var(--brand-contrast); font-weight: 800; flex: none; }
/* Avatar clicable (jugador registrado): abre su ficha admin desde el detalle de reserva. */
button.v2-rd-card__avatar { border: 0; padding: 0; font: inherit; font-weight: 800; cursor: pointer; }
button.v2-rd-card__avatar:hover, button.v2-rd-card__avatar:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.v2-rd-card__body { flex: 1; min-width: 0; }
.v2-rd-card__act { display: flex; gap: var(--sp-2); align-items: center; flex: none; }
.v2-rd-card__method { max-width: 120px; }
.v2-rd-bar { display: flex; gap: var(--sp-2); align-items: center; margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--border); }
.v2-rd-line { padding: 8px 0; border-bottom: 1px solid var(--border); }
/* Móvil: las filas de acciones (por jugador, resumen y barra inferior) tienen hasta 5-8 botones;
   sin wrap se salían de la tarjeta. Envuelven y los botones reparten el ancho de cada fila. */
@media (max-width: 720px) {
  .v2-rd-card { flex-wrap: wrap; }
  .v2-rd-card__act, .v2-rd-summary__pay {
    width: 100%; margin-left: 0;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: var(--sp-2);
  }
  .v2-rd-card__act > .btn, .v2-rd-summary__pay > .btn { padding-left: var(--sp-2); padding-right: var(--sp-2); }
  .v2-rd-bar { flex-wrap: wrap; }
  .v2-rd-bar > .btn { flex: 1 1 auto; min-width: 96px; justify-content: center; }
}
.v2-rd-add { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-3); }
.v2-rd-add > span { flex: none; font-weight: 700; }
.v2-rd-add .v2-ac-wrap { flex: 1; }
/* Cargos adicionales = TPV embebido */
.v2-rd-charge__cart { border: 1px solid var(--border); border-radius: var(--r-md); max-height: 180px; overflow-y: auto; background: var(--surface-2); }
.v2-rd-charge__line { display: flex; align-items: center; gap: var(--sp-2); padding: 6px var(--sp-2); border-bottom: 1px solid var(--border); }
.v2-rd-charge__line:last-child { border-bottom: none; }
.v2-rd-charge .admin-pos-browser__grid { max-height: 300px; overflow-y: auto; }
.admin-pos-browser-tile__price { color: var(--brand); font-weight: 700; }

/* ─────────────────────────── Tienda del club ───────────────────────────
   Catálogo, ficha con galería y contador del carrito. La foto manda: los
   productos de tienda (palas, ropa) se eligen por la imagen, no por el texto. */
.v2-shop-item__photo {
  display: block; width: 100%; height: 180px; border: 0; padding: 0; cursor: pointer;
  border-radius: var(--r-md); background: var(--surface-2) center/cover no-repeat;
  font-size: 40px; line-height: 180px; text-align: center; color: var(--muted);
}
.v2-shop-item__photo:hover { filter: brightness(1.04); }
.v2-shop-item__name {
  display: block; width: 100%; text-align: left; border: 0; background: none; padding: 0;
  cursor: pointer; font: inherit; font-weight: 700; color: inherit; margin-top: 2px;
}
.v2-shop-item__name:hover { color: var(--brand); }
.v2-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Chip con el número de artículos, dentro de la pestaña «Carrito». */
.v2-shop-badge {
  display: inline-block; min-width: 20px; margin-left: 6px; padding: 0 6px;
  border-radius: 999px; background: var(--brand); color: var(--on-brand, #fff);
  font-size: var(--fs-xs); font-weight: 700; text-align: center;
}

/* Ficha: foto grande a la izquierda, datos a la derecha; en móvil, apiladas. */
.v2-shop-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.v2-shop-photo {
  width: 100%; aspect-ratio: 1 / 1; border-radius: var(--r-md);
  background: var(--surface-2) center/cover no-repeat; color: var(--muted);
}
.v2-shop-thumbs { display: flex; gap: var(--sp-2); margin-top: var(--sp-2); flex-wrap: wrap; }
.v2-shop-thumb {
  width: 64px; height: 64px; border-radius: var(--r-sm); cursor: pointer;
  border: 2px solid var(--border); background: var(--surface-2) center/cover no-repeat; padding: 0;
}
.v2-shop-thumb.is-active { border-color: var(--brand); }
.v2-shop-features { margin: 0; padding-left: 1.1em; }
.v2-shop-features li { margin: 4px 0; }
@media (max-width: 720px) { .v2-shop-detail { grid-template-columns: 1fr; } }

/* Campo de imagen del formulario admin (miniatura + ruta + botón de subir). */
.v2-field__image { display: flex; align-items: center; gap: var(--sp-2); }
.v2-field__thumb {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface-2) center/cover no-repeat;
}
