/* Panel web del organizador — crewargentina.com/organizador
 *
 * Es la misma app, en la compu. Los valores de acá son los de la app de torneos
 * (CREW-APP/src/constants/colors.ts, tipografia.ts y formas.ts): quien organiza tiene que
 * sentir que está en el mismo lugar. Si cambia un token allá, se cambia acá.
 *
 * NO usa css/base.css del sitio de CREW: ese archivo pone `button { width: 100% }` global y
 * otros estilos de la tienda que acá romperían todo.
 */

/* ─── Colores ───────────────────────────────────────────────────────────────────────────────
 * Oscuro = el de siempre (el de la app). El modo claro (html[data-tema="claro"], abajo) sólo
 * reemplaza estas variables: ninguna regla se escribe dos veces. Mismo sistema y misma elección
 * guardada (localStorage `crew_tema`) que el admin de CREW.
 *
 * El teléfono dibujado (.telefono, .crear-tel) muestra la APP, que es oscura: en modo claro vuelve
 * a tomar estos valores oscuros por tener más especificidad que el bloque claro.
 */
:root,
html[data-tema="claro"] .telefono,
html[data-tema="claro"] .crear-tel {
  /* Colores (colors.ts, marca CREW) */
  --bg: #0a0a0a;
  --bg-card: #111111;
  --bg-card-pressed: #181818;
  --bg-input: #0e0e0e;
  --bg-esqueleto: #1e1e1e;
  --border: #1e1e1e;
  --border-fuerte: #2a2a2a;
  --text: #ffffff;
  --text-dim: #aaaaaa;
  --text-muted: #666666;
  --ok: #22c55e;
  --ok-bg: rgba(34,197,94,0.08);
  --ok-border: rgba(34,197,94,0.4);
  --warn: #eab308;
  --warn-bg: rgba(234,179,8,0.08);
  --warn-border: rgba(234,179,8,0.4);
  --err: #f87171;
  --err-bg: rgba(248,113,113,0.05);
  --err-border: rgba(248,113,113,0.4);
  --cyan: #1db6d9;
  --azul: #4a7fff;
  --border-hi: rgba(29,182,217,0.35);
  --accent-soft: rgba(29,182,217,0.07);
  --accent-soft-pressed: rgba(29,182,217,0.13);
  --on-accent: #04222b;
  /* Del panel (no están en la app). Cada uno vale exactamente el color que había escrito a mano. */
  --bg-header: rgba(10,10,10,0.92);
  --bg-sutil: #0d0d0d;
  --bg-fila-hover: #141414;
  --bg-flotante: #151515;
  --bg-barra-cambios: #161616;
  --bg-toast: #1a1a1a;
  --bg-modal-fondo: rgba(0,0,0,0.65);
  --bg-transparente: rgba(10,10,10,0);
  --border-hover: #3a3a3a;
  --text-agarre: #444;
  --on-err: #2a0808;
  --err-bg-hover: rgba(248,113,113,0.12);
  --err-bg-fila: rgba(248,113,113,0.03);
  --err-bg-fila-alerta: rgba(248,113,113,0.04);
  --warn-bg-suave: rgba(234,179,8,0.06);
  --seleccion: rgba(29,182,217,0.35);
  --foco: rgba(29,182,217,0.12);
  --foco-fuerte: rgba(29,182,217,0.25);
  --foco-partido: rgba(29,182,217,0.3);
  --sombra-suave: rgba(0,0,0,.5);
  --sombra-menu: rgba(0,0,0,.55);
  --sombra-fuerte: rgba(0,0,0,.6);
  --sombra-modal: rgba(0,0,0,0.6);
  --tachado: rgba(255,255,255,0.25);
  --rayado: rgba(255,255,255,0.025);

  /* Radios (formas.ts). Ante la duda, la esquina va más redonda. */
  --r-chico: 8px;
  --r-medio: 12px;
  --r-grande: 18px;
  --r-enorme: 24px;
  --r-pill: 999px;

  /* Tipografía (tipografia.ts) */
  --f-regular: 400;
  --f-medium: 500;
  --f-semibold: 600;
  --f-bold: 700;

  --ancho-contenido: 1080px;
  --ancho-lateral: 256px;
  --alto-header: 64px;
}

/* Modo claro: para leer al sol. Grises del admin de CREW; el celeste de los textos un punto más
 * oscuro (#1897b4, el mismo del admin) porque el #1db6d9 sobre blanco casi no se lee. */
html[data-tema="claro"] {
  --bg: #f4f5f7;
  --bg-card: #ffffff;
  --bg-card-pressed: #eef0f3;
  --bg-input: #f8f9fb;
  --bg-esqueleto: #e5e7eb;
  --border: #e4e6ea;
  --border-fuerte: #d5d8de;
  --text: #15181d;
  --text-dim: #4a4f57;
  --text-muted: #7b818a;
  --ok: #15803d;
  --ok-bg: rgba(22,163,74,0.08);
  --ok-border: rgba(22,163,74,0.35);
  --warn: #a16207;
  --warn-bg: rgba(234,179,8,0.12);
  --warn-border: rgba(202,138,4,0.45);
  --err: #dc2626;
  --err-bg: rgba(220,38,38,0.05);
  --err-border: rgba(220,38,38,0.35);
  --cyan: #1897b4;
  --azul: #3b6ef5;
  --border-hi: rgba(24,151,180,0.4);
  --accent-soft: rgba(24,151,180,0.07);
  --accent-soft-pressed: rgba(24,151,180,0.13);
  --on-accent: #ffffff;
  --bg-header: rgba(244,245,247,0.92);
  --bg-sutil: #f7f8fa;
  --bg-fila-hover: #f3f5f8;
  --bg-flotante: #ffffff;
  --bg-barra-cambios: #ffffff;
  --bg-toast: #ffffff;
  --bg-modal-fondo: rgba(15,23,42,0.35);
  --bg-transparente: rgba(244,245,247,0);
  --border-hover: #b8bdc6;
  --text-agarre: #a2a8b1;
  --on-err: #ffffff;
  --err-bg-hover: rgba(220,38,38,0.1);
  --err-bg-fila: rgba(220,38,38,0.035);
  --err-bg-fila-alerta: rgba(220,38,38,0.05);
  --warn-bg-suave: rgba(234,179,8,0.1);
  --seleccion: rgba(24,151,180,0.22);
  --foco: rgba(24,151,180,0.16);
  --foco-fuerte: rgba(24,151,180,0.3);
  --foco-partido: rgba(24,151,180,0.3);
  --sombra-suave: rgba(15,23,42,.12);
  --sombra-menu: rgba(15,23,42,.14);
  --sombra-fuerte: rgba(15,23,42,.14);
  --sombra-modal: rgba(15,23,42,0.18);
  --tachado: rgba(0,0,0,0.3);
  --rayado: rgba(0,0,0,0.045);
}
/* El teléfono recupera los colores oscuros de arriba, pero el color de letra lo hereda ya calculado
 * del body (claro): hay que volver a pedirlo adentro. */
html[data-tema="claro"] .telefono,
html[data-tema="claro"] .crear-tel { color: var(--text); }
html[data-tema="claro"] input[type="date"].input,
html[data-tema="claro"] input[type="time"].input,
html[data-tema="claro"] input[type="datetime-local"].input { color-scheme: light; }

/* Interruptor claro/oscuro: redondo, arriba a la derecha, como el del admin (y chivilcoy.org).
 * Los dos íconos están siempre; se ve el del tema al que se pasa. */
.btn-tema { width: 40px; height: 40px; flex: none; margin: 0; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; cursor: pointer; background: var(--bg-card); border: 1px solid var(--border-fuerte); color: var(--text-dim); transition: color .15s, border-color .15s, background .15s; }
.btn-tema:hover { color: var(--cyan); border-color: var(--border-hi); }
.btn-tema svg { width: 19px; height: 19px; display: block; }
.btn-tema .ico-luna { display: none; }
html[data-tema="claro"] .btn-tema .ico-sol { display: none; }
html[data-tema="claro"] .btn-tema .ico-luna { display: block; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 21px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img { max-width: 100%; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
::selection { background: var(--seleccion); }

/* ─── Los 8 roles de texto ─────────────────────────────────────────────────────────────── */
.t-display   { font-weight: 700; font-size: 38px; line-height: 44px; font-variant-numeric: tabular-nums; }
.t-titulo    { font-weight: 700; font-size: 26px; line-height: 30px; letter-spacing: -0.4px; }
.t-subtitulo { font-weight: 600; font-size: 18px; line-height: 23px; letter-spacing: -0.2px; }
.t-cuerpo    { font-weight: 400; font-size: 15px; line-height: 21px; }
.t-fuerte    { font-weight: 600; font-size: 15px; line-height: 21px; }
.t-apoyo     { font-weight: 400; font-size: 13px; line-height: 18px; }
.t-etiqueta  { font-weight: 600; font-size: 11px; line-height: 14px; letter-spacing: 1.1px; text-transform: uppercase; }
.t-dato      { font-weight: 700; font-size: 16px; line-height: 20px; font-variant-numeric: tabular-nums; }
.dim   { color: var(--text-dim); }
.muted { color: var(--text-muted); }
.cyan  { color: var(--cyan); }
.ok    { color: var(--ok); }
.warn  { color: var(--warn); }
.err   { color: var(--err); }
h1, h2, h3, p { margin: 0; }

/* ─── Estructura ───────────────────────────────────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 30;
  height: var(--alto-header);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  background: var(--bg-header);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-marca { display: flex; align-items: center; gap: 10px; color: var(--text); }
.header-marca:hover { text-decoration: none; }
.header-marca img { width: 30px; height: 30px; }
.header-marca span { font-weight: 700; font-size: 18px; letter-spacing: -0.2px; }
.header-marca small { font-weight: 600; font-size: 11px; letter-spacing: 1.1px; text-transform: uppercase; color: var(--text-muted); margin-left: 4px; }
.header-espacio { flex: 1; }
.header-cuenta { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header-cuenta .nombre { color: var(--text-dim); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }

.pagina { max-width: var(--ancho-contenido); margin: 0 auto; padding: 32px 24px 80px; }
.pagina-angosta { max-width: 720px; }

.con-lateral { display: grid; grid-template-columns: var(--ancho-lateral) minmax(0, 1fr); min-height: calc(100vh - var(--alto-header)); }
.lateral {
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  position: sticky; top: var(--alto-header);
  height: calc(100vh - var(--alto-header));
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 20px;
}
.lateral-volver { color: var(--text-dim); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; }
/* Página de torneo: sin header arriba, todo vive en el lateral (diseño "Panel del Organizador"). */
.con-lateral.sin-header { min-height: 100vh; --ancho-lateral: 272px; }
.sin-header .lateral { top: 0; height: 100vh; gap: 18px; padding: 20px 14px 14px; }
.lateral-marca { display: flex; align-items: center; gap: 10px; padding: 0 6px; color: var(--text); }
.lateral-marca:hover { text-decoration: none; }
.lateral-marca img { width: 30px; height: 30px; flex-shrink: 0; }
.lateral-marca span { display: flex; flex-direction: column; min-width: 0; }
.lateral-marca strong { font-weight: 700; font-size: 15px; line-height: 18px; }
.lateral-marca small { font-weight: 500; font-size: 12px; line-height: 15px; color: var(--text-muted); }

.lateral-torneo { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--border-fuerte); border-radius: var(--r-grande); background: var(--bg-card); }
.lateral-torneo-fila { display: flex; align-items: center; gap: 8px; min-width: 0; }
.punto-color { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.lateral-torneo-nombre { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lateral-torneo-bajada { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lateral-cambiar { flex-shrink: 0; }

.selector-torneos { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0; background: var(--bg-card); border: 1px solid var(--border-fuerte); border-radius: var(--r-grande); box-shadow: 0 18px 50px var(--sombra-fuerte); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.selector-lista { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.selector-lista .rueda { margin: 12px auto; }
.selector-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-medio); color: var(--text); }
.selector-item > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.selector-item .t-fuerte { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selector-item:hover { background: var(--bg-card-pressed); text-decoration: none; }
.selector-item.activo { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--border-hi); }
.selector-todos { display: flex; align-items: center; gap: 6px; padding: 10px 8px 6px; border-top: 1px solid var(--border); margin-top: 4px; color: var(--text-dim); font-size: 13px; }
.selector-vacio { padding: 10px 8px; }

.nav { display: flex; flex-direction: column; gap: 16px; flex: 1; }
.nav-grupo { display: flex; flex-direction: column; gap: 2px; }
.nav-titulo { padding: 0 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: var(--r-medio);
  color: var(--text-dim); font-weight: 500;
}
.nav a:hover { background: var(--bg-card); text-decoration: none; color: var(--text); }
.nav a.activo { background: var(--accent-soft); color: var(--cyan); font-weight: 600; box-shadow: inset 0 0 0 1px var(--border-hi); }
.nav a.pronto { color: var(--text-muted); gap: 10px; }
.nav a.pronto.activo { color: var(--text-dim); background: var(--bg-card); box-shadow: inset 0 0 0 1px var(--border-fuerte); }
.nav svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-texto { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-pronto { flex-shrink: 0; font-size: 9px; line-height: 13px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; padding: 1px 6px; border-radius: var(--r-pill); border: 1px solid var(--border-fuerte); color: var(--text-muted); }

.lateral-cuenta { display: flex; align-items: center; gap: 10px; padding: 12px 6px 0; border-top: 1px solid var(--border); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--bg-card-pressed); border: 1px solid var(--border-fuerte); color: var(--text-dim); font-size: 12px; font-weight: 700; }
.lateral-cuenta-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lateral-cuenta-texto > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lateral-cuenta-texto .t-fuerte { font-size: 14px; line-height: 18px; }

/* Configuración: pestañas arriba; cada pestaña trae su bajada pero el título ya lo pone la sección. */
.pestanas { display: flex; gap: 4px; flex-wrap: wrap; margin: -8px 0 24px; padding: 4px; border: 1px solid var(--border); border-radius: var(--r-grande); background: var(--bg-card); width: fit-content; max-width: 100%; }
.pestanas a { padding: 8px 14px; border-radius: var(--r-medio); color: var(--text-dim); font-weight: 500; font-size: 14px; white-space: nowrap; }
.pestanas a:hover { color: var(--text); background: var(--bg-card-pressed); text-decoration: none; }
.pestanas a.activa { color: var(--cyan); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--border-hi); font-weight: 600; }
.config-cuerpo > .encabezado h1 { display: none; }
.config-cuerpo > .encabezado .bajada { margin-top: 0; }
.principal { padding: 32px 40px 96px; min-width: 0; }
/* Fila del interruptor claro/oscuro, arriba a la derecha (como en el admin). Sube un poco para que
 * el título de cada sección no quede lejos. */
.principal-barra { display: flex; justify-content: flex-end; margin: -16px 0 4px; }
.principal-interior { max-width: 960px; }
.principal-interior.ancho { max-width: 1180px; }

.encabezado { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.encabezado .bajada { margin-top: 6px; color: var(--text-dim); }
.acciones { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.seccion { display: flex; flex-direction: column; gap: 10px; }
.seccion + .seccion { margin-top: 28px; }
.seccion-cabeza { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.seccion-cabeza .t-etiqueta { color: var(--text-dim); }
.pila { display: flex; flex-direction: column; gap: 10px; }
.pila-grande { display: flex; flex-direction: column; gap: 18px; }
.fila-flex { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grilla-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grilla-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grilla-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }

/* ─── Tarjetas ─────────────────────────────────────────────────────────────────────────── */
.tarjeta { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-enorme); padding: 20px; }
.tarjeta.fila { border-radius: var(--r-grande); padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.tarjeta.destacada { border-color: var(--border-hi); background: var(--accent-soft); }
.tarjeta-tocable { cursor: pointer; transition: background .12s; color: inherit; }
.tarjeta-tocable:hover { background: var(--bg-card-pressed); text-decoration: none; }
.tarjeta-tocable:active { background: var(--accent-soft-pressed); }
.tarjeta .titulo-tarjeta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.flecha { color: var(--text-muted); font-size: 22px; line-height: 1; }

/* ─── Botones (Boton.tsx) ──────────────────────────────────────────────────────────────── */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: var(--r-grande);
  font-weight: 600; font-size: 15px; line-height: 21px;
  border: 1px solid transparent; cursor: pointer;
  background: var(--accent-soft); border-color: var(--border-hi); color: var(--cyan);
  white-space: nowrap; text-decoration: none; position: relative;
  transition: background .12s, opacity .12s;
}
.boton:hover { background: var(--accent-soft-pressed); text-decoration: none; }
.boton:disabled, .boton[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.boton svg { width: 16px; height: 16px; }
.boton.compacto { padding: 8px 12px; font-size: 13px; line-height: 18px; border-radius: var(--r-medio); }
.boton.secundario { background: var(--bg-input); border-color: var(--border-fuerte); color: var(--text-dim); }
.boton.secundario:hover { background: var(--bg-card-pressed); color: var(--text); }
.boton.fantasma { background: transparent; border-color: transparent; color: var(--text-dim); }
.boton.fantasma:hover { background: var(--bg-card); color: var(--text); }
.boton.relleno { background: var(--cyan); border-color: var(--cyan); color: var(--on-accent); }
.boton.relleno:hover { opacity: .88; }
.boton.peligro { background: var(--err-bg); border-color: var(--err-border); color: var(--err); }
.boton.peligro:hover { background: var(--err-bg-hover); }
.boton.peligro-relleno { background: var(--err); border-color: var(--err); color: var(--on-err); }
.boton.precaucion { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn); }
.boton.cargando { color: transparent !important; pointer-events: none; }
.boton.cargando::after {
  content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--cyan); border-right-color: transparent; animation: girar .7s linear infinite;
}
.boton.relleno.cargando::after { border-color: var(--on-accent); border-right-color: transparent; }
@keyframes girar { to { transform: rotate(360deg); } }
.link { background: none; border: 0; padding: 0; color: var(--cyan); font-weight: 600; font-size: 13px; cursor: pointer; }
.link:hover { text-decoration: underline; }
.link.peligro { color: var(--err); }
.link.dim { color: var(--text-dim); }

/* ─── Chips (Chip.tsx) ─────────────────────────────────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--r-pill);
  background: var(--bg-input); border: 1px solid var(--border-fuerte);
  color: var(--text-dim); font-weight: 500; font-size: 13px; line-height: 18px; cursor: pointer;
  transition: background .12s;
}
.chip:hover { color: var(--text); }
.chip.activo { background: var(--accent-soft); border-color: var(--border-hi); color: var(--cyan); font-weight: 600; }

/* ─── Formularios ──────────────────────────────────────────────────────────────────────── */
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo > label, .rotulo { font-weight: 600; font-size: 11px; line-height: 14px; letter-spacing: 1.1px; text-transform: uppercase; color: var(--text-dim); }
.ayuda { font-size: 13px; line-height: 18px; color: var(--text-muted); }
.ayuda.warn { color: var(--warn); }   /* .warn sola pierde: está antes en el archivo */
.input, .select, .textarea {
  width: 100%; background: var(--bg-input); color: var(--text);
  border: 1px solid var(--border-fuerte); border-radius: var(--r-grande);
  padding: 12px 14px; font-size: 15px; line-height: 21px; outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--border-hi); box-shadow: 0 0 0 3px var(--foco); }
.input.invalido { border-color: var(--err-border); }
.select { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23aaaaaa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.select option { background: var(--bg-flotante); color: var(--text); }
.textarea { min-height: 96px; resize: vertical; }
input[type="date"].input, input[type="time"].input, input[type="datetime-local"].input { color-scheme: dark; }
.input.chico, .select.chico { padding: 8px 10px; font-size: 13px; line-height: 18px; border-radius: var(--r-medio); }
.select.chico { padding-right: 30px; background-position: right 10px center; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .caja { width: 22px; height: 22px; border-radius: var(--r-chico); border: 1px solid var(--border-fuerte); background: var(--bg-input); flex-shrink: 0; display: grid; place-items: center; color: var(--on-accent); font-size: 14px; font-weight: 700; }
.check input:checked + .caja { background: var(--cyan); border-color: var(--cyan); }
.check input:checked + .caja::after { content: '✓'; }
.check input:focus-visible + .caja { box-shadow: 0 0 0 3px var(--foco-fuerte); }
.formulario-pie { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.guardado { color: var(--ok); font-size: 13px; }

/* ─── Estados: error, vacío, carga ─────────────────────────────────────────────────────── */
.caja-error { background: var(--err-bg); border: 1px solid var(--err-border); color: var(--err); border-radius: var(--r-grande); padding: 12px 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.caja-aviso { background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn); border-radius: var(--r-grande); padding: 12px 14px; }
.caja-ok { background: var(--ok-bg); border: 1px solid var(--ok-border); color: var(--ok); border-radius: var(--r-grande); padding: 12px 14px; }
.caja-info { background: var(--accent-soft); border: 1px solid var(--border-hi); color: var(--text-dim); border-radius: var(--r-grande); padding: 12px 14px; }
.vacio { text-align: center; padding: 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.vacio .circulo { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--border-hi); display: grid; place-items: center; color: var(--cyan); margin-bottom: 6px; }
.vacio .circulo svg { width: 26px; height: 26px; }
.vacio .t-apoyo { color: var(--text-dim); max-width: 380px; }
.vacio .boton { margin-top: 10px; }
.esqueleto { background: var(--bg-esqueleto); border-radius: var(--r-chico); animation: latir 1.4s ease-in-out infinite; }
@keyframes latir { 50% { opacity: .5; } }
.rueda { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--cyan); border-right-color: transparent; animation: girar .7s linear infinite; margin: 40px auto; }

/* ─── Insignias (EscudoEquipo.tsx) ─────────────────────────────────────────────────────── */
.insignia { flex-shrink: 0; display: grid; place-items: center; font-weight: 700; border: 1px solid; overflow: hidden; }
.insignia img { width: 100%; height: 100%; object-fit: cover; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--border-hi); color: var(--cyan); display: grid; place-items: center; flex-shrink: 0; }

/* ─── Sellos ───────────────────────────────────────────────────────────────────────────── */
.sello { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 11px; line-height: 14px; letter-spacing: .6px; text-transform: uppercase; padding: 3px 8px; border-radius: var(--r-pill); border: 1px solid var(--border-fuerte); color: var(--text-muted); white-space: nowrap; }
.sello.ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-border); }
.sello.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-border); }
.sello.cyan { color: var(--cyan); background: var(--accent-soft); border-color: var(--border-hi); }
.sello.err { color: var(--err); background: var(--err-bg); border-color: var(--err-border); }

/* ─── Tablas ───────────────────────────────────────────────────────────────────────────── */
.tabla-marco { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-grande); background: var(--bg-card); }
.tabla { width: 100%; border-collapse: collapse; }
.tabla th { text-align: left; font-weight: 600; font-size: 11px; line-height: 14px; letter-spacing: 1.1px; text-transform: uppercase; color: var(--text-muted); padding: 12px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--bg-sutil); }
.tabla td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tbody tr:hover td { background: var(--bg-fila-hover); }
.tabla .num { text-align: right; font-variant-numeric: tabular-nums; }
.tabla .acciones-celda { text-align: right; white-space: nowrap; }
.tabla .acciones-celda .link + .link { margin-left: 14px; }
.tabla tr.editando td { background: var(--accent-soft) !important; }
.tabla tr.con-error td { background: var(--err-bg) !important; }
.tabla tr.hecho td { background: var(--ok-bg) !important; }
.tabla tr.cambiado td { background: var(--warn-bg-suave) !important; }

/* ─── Modal y avisos flotantes ─────────────────────────────────────────────────────────── */
.modal-fondo { position: fixed; inset: 0; z-index: 100; background: var(--bg-modal-fondo); display: grid; place-items: center; padding: 24px; animation: aparecer .12s ease-out; }
.modal { background: var(--bg-card); border: 1px solid var(--border-fuerte); border-radius: var(--r-enorme); width: 100%; max-width: 520px; max-height: calc(100vh - 48px); display: flex; flex-direction: column; box-shadow: 0 24px 80px var(--sombra-modal); }
.modal.ancho { max-width: 1040px; }
.modal-cabeza { padding: 20px 24px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-cuerpo { padding: 16px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-pie { padding: 0 24px 20px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.modal-cerrar { background: none; border: 0; color: var(--text-muted); font-size: 22px; cursor: pointer; line-height: 1; padding: 4px; }
@keyframes aparecer { from { opacity: 0; } }
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--bg-toast); border: 1px solid var(--border-fuerte); color: var(--text); padding: 12px 18px; border-radius: var(--r-pill); box-shadow: 0 10px 40px var(--sombra-suave); font-size: 14px; animation: subir .18s ease-out; }
.toast.ok { border-color: var(--ok-border); }
.toast.err { border-color: var(--err-border); color: var(--err); }
@keyframes subir { from { opacity: 0; transform: translateY(8px); } }

/* ─── Solo lectura (rol LECTURA del equipo de trabajo) ─────────────────────────────────── */
/* Lo que guarda no se muestra. Igual api.js lo frena y el servidor lo rechaza: esto es para que la
   pantalla no ofrezca lo que no se puede hacer. */
.aviso-lectura { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.aviso-lectura b { color: var(--text); }
body.solo-lectura .principal .boton.relleno,
body.solo-lectura .principal .boton.peligro,
body.solo-lectura .principal .boton.peligro-relleno,
body.solo-lectura .principal .ar-agregar,
body.solo-lectura .principal .ar-mas,
body.solo-lectura .principal .et-invitar,
body.solo-lectura .principal .et-mas { display: none !important; }

/* ─── Barra fija de cambios sin guardar ────────────────────────────────────────────────── */
.barra-cambios { position: sticky; bottom: 16px; z-index: 20; margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--bg-barra-cambios); border: 1px solid var(--warn-border); border-radius: var(--r-enorme); padding: 12px 14px 12px 20px; box-shadow: 0 16px 50px var(--sombra-fuerte); }

/* ─── Login ────────────────────────────────────────────────────────────────────────────── */
.entrar { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 50% 30%, rgba(29,182,217,0.08), transparent 60%), var(--bg); }
.entrar-caja { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 22px; }
.entrar-marca { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.entrar-marca img { width: 88px; height: 88px; }

/* ─── Mis torneos ──────────────────────────────────────────────────────────────────────── */
.lista-torneos { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card-torneo { display: flex; gap: 14px; align-items: center; padding: 16px; }
.card-torneo .textos { flex: 1; min-width: 0; }
.card-torneo .t-fuerte { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── Colores: vista previa del teléfono ───────────────────────────────────────────────── */
.colores-grilla { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.muestra-color { display: flex; gap: 10px; align-items: center; }
.muestra-color input[type="color"] { width: 48px; height: 48px; border: 1px solid var(--border-fuerte); border-radius: var(--r-medio); background: var(--bg-input); padding: 4px; cursor: pointer; }
.muestra-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.muestra-color input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 8px; }
.telefono { width: 300px; border-radius: 40px; border: 1px solid var(--border-fuerte); background: #050505; padding: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.6); position: sticky; top: calc(var(--alto-header) + 24px); }
.telefono-pantalla { border-radius: 32px; overflow: hidden; background: var(--bg); min-height: 520px; display: flex; flex-direction: column; }
.telefono-header { padding: 34px 16px 14px; display: flex; align-items: center; gap: 10px; }
.telefono-header .t-fuerte { flex: 1; text-align: center; margin-right: 32px; }
.telefono-atras { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.2); font-size: 18px; }
.telefono-cuerpo { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.telefono-tabla-fila { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; font-size: 13px; }
.telefono-barra { margin-top: auto; display: flex; justify-content: space-around; padding: 10px 6px 14px; border-top: 1px solid var(--border); font-size: 10px; color: var(--text-muted); }
.telefono-barra span { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.telefono-barra i { width: 18px; height: 18px; border-radius: 6px; background: #2a2a2a; display: block; }

/* ─── Subida de imagen ─────────────────────────────────────────────────────────────────── */
.subir-imagen { display: flex; align-items: center; gap: 16px; }
.subir-imagen .vista { width: 84px; height: 84px; border-radius: 22px; background: var(--bg-input); border: 1px dashed var(--border-fuerte); display: grid; place-items: center; overflow: hidden; color: var(--text-muted); font-weight: 700; font-size: 28px; flex-shrink: 0; }
.subir-imagen .vista.circulo { border-radius: 50%; }
.subir-imagen .vista img { width: 100%; height: 100%; object-fit: cover; }

/* ─── Buscador de lugar ────────────────────────────────────────────────────────────────── */
.lugar { position: relative; }
.lugar-sugerencias { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; background: var(--bg-flotante); border: 1px solid var(--border-fuerte); border-radius: var(--r-grande); overflow: hidden; box-shadow: 0 16px 40px var(--sombra-suave); }
.lugar-sugerencias button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border); padding: 11px 14px; cursor: pointer; }
.lugar-sugerencias button:last-child { border-bottom: 0; }
.lugar-sugerencias button:hover, .lugar-sugerencias button.activa { background: var(--accent-soft); }
/* Sin tamaño, el pin del SVG no se dibujaba: el ícono estaba desde el primer día y nunca se vio
   (también en la sede del torneo, es el mismo componente). */
.lugar-elegido svg { width: 18px; height: 18px; display: block; }
.lugar-elegido { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border-hi); background: var(--accent-soft); border-radius: var(--r-grande); }

/* ─── Equipos ──────────────────────────────────────────────────────────────────────────── */
.pestanas { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.zona { border: 1px solid var(--border); border-radius: var(--r-enorme); background: var(--bg-card); }
.zona + .zona { margin-top: 14px; }
.zona-cabeza { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.zona-cuerpo { padding: 14px; }
.equipos-grilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.equipo-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-grande); background: var(--bg-sutil); border: 1px solid var(--border); cursor: pointer; color: inherit; text-align: left; width: 100%; }
.equipo-card:hover { background: var(--bg-card-pressed); border-color: var(--border-fuerte); }
.equipo-card .textos { flex: 1; min-width: 0; }
.equipo-card .t-fuerte { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agregar-equipo { display: flex; gap: 8px; margin-top: 12px; }
.agregar-equipo .input { flex: 1; }
.pegar-area { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 19px; min-height: 180px; white-space: pre; }
.mapa-columnas th .select { min-width: 150px; text-transform: none; letter-spacing: 0; font-weight: 500; }

/* ─── Fixture ──────────────────────────────────────────────────────────────────────────── */
.jornada { border: 1px solid var(--border); border-radius: var(--r-enorme); background: var(--bg-card); overflow: hidden; }
.jornada + .jornada { margin-top: 14px; }
.jornada-cabeza { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--bg-sutil); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.jornada-cabeza .t-fuerte { min-width: 80px; }
.partido { display: grid; grid-template-columns: minmax(0, 1fr) 146px 104px 150px auto; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.partido:last-child { border-bottom: 0; }
.partido.cambiado { background: var(--warn-bg-suave); }
.partido.oculto .equipos { opacity: .45; }
.partido .equipos { display: flex; align-items: center; gap: 8px; min-width: 0; }
.partido .equipo-nombre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.partido .vs { color: var(--text-muted); font-size: 12px; flex-shrink: 0; }
.partido .resultado { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text); padding: 0 4px; flex-shrink: 0; }
.partido-acciones { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.icono-boton { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-medio); border: 1px solid var(--border-fuerte); background: var(--bg-input); color: var(--text-dim); cursor: pointer; }
.icono-boton:hover { color: var(--text); background: var(--bg-card-pressed); }
.icono-boton.activo { color: var(--warn); border-color: var(--warn-border); background: var(--warn-bg); }
.icono-boton.peligro:hover { color: var(--err); border-color: var(--err-border); }
.icono-boton svg { width: 16px; height: 16px; }
.dias { display: flex; gap: 6px; flex-wrap: wrap; }
.guardando .jornada { pointer-events: none; opacity: .6; transition: opacity .15s; }

/* ─── Responsive ───────────────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .partido { grid-template-columns: minmax(0, 1fr) 140px 96px; }
  .partido .celda-cancha { grid-column: 1 / 2; }
  .partido-acciones { grid-column: 2 / 4; }
}
@media (max-width: 900px) {
  .con-lateral { grid-template-columns: 1fr; }
  .lateral, .sin-header .lateral { position: relative; top: auto; height: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 14px 16px; gap: 12px; }
  .lateral-torneo { padding: 10px 12px; }
  .nav { flex-direction: row; overflow-x: auto; gap: 6px; flex: none; }
  .nav-grupo { display: contents; }
  .nav-titulo { display: none; }
  .nav a { white-space: nowrap; padding: 9px 12px; }
  .nav-texto { overflow: visible; }
  .lateral-cuenta { position: absolute; top: 12px; right: 12px; padding: 0; border: 0; }
  .lateral-cuenta .avatar, .lateral-cuenta-texto { display: none; }
  .principal { padding: 24px 16px 96px; }
  .colores-grilla { grid-template-columns: 1fr; }
  .telefono { position: static; margin: 0 auto; }
  .grilla-3, .grilla-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .header { padding: 0 16px; }
  .header-marca small { display: none; }
  .header-cuenta .nombre { display: none; }
  .pagina { padding: 24px 16px 80px; }
  .grilla-2, .grilla-3, .grilla-4 { grid-template-columns: 1fr; }
  .partido { grid-template-columns: 1fr 1fr; }
  .partido .equipos { grid-column: 1 / 3; }
  .partido .celda-cancha { grid-column: 1 / 2; }
  .partido-acciones { grid-column: 2 / 3; }
  .telefono { width: 100%; max-width: 300px; }
  .t-titulo { font-size: 22px; line-height: 27px; }
}
