/* Pieza 3: Eventos, ficha del evento, Patrocinios y Ajustes. Teléfono primero; la computadora desde 900 px.
   Usa los tokens y componentes de base.css (navy y lima solo como acentos, fondos blancos y gris claro). */

/* ---------- Controles ---------- */
.rejilla-2, .rejilla-3 { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.rejilla-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 380px) { .rejilla-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.crece { flex: 1; min-width: 0; display: grid; gap: 2px; }
.texto-rojo { color: var(--rojo); font-weight: 650; }
.oculto-visual { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
textarea.entrada.area { min-height: 0; line-height: 1.45; }

.segmentado { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 13px; background: #eaeef2; max-width: 100%; }
.segmentado button {
  flex: 1 0 auto; min-height: 40px; padding: 8px 14px; border: 0; border-radius: 10px; background: transparent; color: var(--texto-2);
  font-weight: 700; font-size: 14.5px; cursor: pointer; transition: background .2s, color .2s, box-shadow .2s;
}
.segmentado button:hover { color: var(--texto); }
.segmentado button.activo { background: var(--superficie); color: var(--navy); box-shadow: 0 1px 3px rgba(0, 38, 58, .14); }
.segmentado.chico button { min-height: 36px; padding: 6px 12px; font-size: 14px; }

.fichas { display: flex; flex-wrap: wrap; gap: 8px; }
.fichas button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--borde-2); background: var(--superficie); color: var(--texto-2); font-weight: 700; font-size: 14px; cursor: pointer;
}
.fichas button .ic { width: 15px; height: 15px; }
.fichas button.activa { background: var(--lima-suave); border-color: var(--lima-2); color: var(--lima-texto); }

.interruptor { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; min-height: 44px; padding: 4px 0; }
.interruptor input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.interruptor-pista {
  flex: none; position: relative; width: 46px; height: 28px; border-radius: 999px; background: var(--borde-2); transition: background .2s; margin-top: 1px;
}
.interruptor-pista::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--curva);
}
.interruptor input:checked + .interruptor-pista { background: var(--navy); }
.interruptor input:checked + .interruptor-pista::after { transform: translateX(18px); }
.interruptor input:focus-visible + .interruptor-pista { outline: 3px solid var(--navy-3); outline-offset: 2px; }
.interruptor input:disabled + .interruptor-pista { opacity: .5; }
.interruptor-texto { display: grid; gap: 2px; font-weight: 700; font-size: 15px; }
.interruptor-texto small { font-weight: 500; color: var(--texto-3); font-size: 13px; }

/* ---------- Eventos: filtros y semanas ---------- */
.filtros { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filtros .segmentado { flex: 1 1 100%; }
.filtros .segmentado button { flex: 1; }
.selector.filtro { width: auto; flex: 1 1 140px; min-height: 42px; padding: 8px 36px 8px 12px; font-size: 15px; font-weight: 600; }
@media (min-width: 700px) { .filtros .segmentado { flex: 0 1 auto; } .selector.filtro { flex: 0 1 200px; } }
.ver-antes { align-self: flex-start; margin: -4px 0 -6px; }
.semana { display: grid; gap: 10px; }
.semana.pasada { opacity: .78; }
.semana-titulo { display: flex; align-items: baseline; gap: 8px; font-size: 16px; color: var(--texto); padding: 2px 2px 0; }
.semana-titulo small { font-size: 13.5px; font-weight: 600; color: var(--texto-3); }
.semana-cuenta { margin-left: auto; min-width: 26px; padding: 1px 8px; border-radius: 999px; background: var(--navy-suave); color: var(--navy); font-size: 12.5px; font-weight: 800; text-align: center; }
.ev-lista { display: grid; gap: 10px; }
@media (min-width: 900px) { .ev-lista { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); } }

.ev-tarjeta {
  position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 12px 10px 12px 12px; min-width: 0;
  background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra);
  color: inherit; text-decoration: none; transition: transform .2s var(--curva), box-shadow .2s, border-color .2s;
}
.ev-tarjeta:hover { border-color: var(--borde-2); box-shadow: var(--sombra-alta); transform: translateY(-1px); }
.ev-tarjeta:active { transform: scale(.99); }
.ev-tarjeta.con-alerta { border-color: #f1c4c0; }
.ev-tarjeta.con-alerta::before { content: ''; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--rojo); }
.ev-tarjeta.apagado { opacity: .62; }
.ev-tarjeta.apagado .ev-nombre { text-decoration: line-through; text-decoration-color: rgba(15, 34, 51, .35); }
.ev-texto { display: grid; gap: 4px; min-width: 0; flex: 1; }
.ev-nombre { font-size: 15px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ev-texto > small { color: var(--texto-2); font-size: 13.5px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ev-pie { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 2px; }
.ev-tipo { font-size: 12.5px; font-weight: 750; color: var(--texto-3); text-transform: uppercase; letter-spacing: .04em; }
.ev-cupo, .ev-patrocinador { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--texto-2); }
.ev-cupo .ic, .ev-patrocinador .ic { width: 15px; height: 15px; }
.ev-cupo.bajo { color: var(--ambar); }
.ev-patrocinador { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--lima-texto); }
.ev-alerta { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; margin-top: 2px; }
.ev-alerta .ic { width: 16px; height: 16px; }
.ev-alerta.rojo { color: var(--rojo); }
.ev-alerta.ambar { color: var(--ambar); }
.ev-flecha { align-self: center; color: var(--texto-3); }
.ev-flecha .ic { width: 18px; height: 18px; }

/* ---------- Ficha: cabecera y acciones ---------- */
.ficha-cab { display: grid; gap: 8px; }
.ficha-cab h1 { font-size: 23px; line-height: 1.22; color: var(--navy); overflow-wrap: anywhere; }
.ficha-etiquetas { display: flex; flex-wrap: wrap; gap: 6px; }
.ficha-sub { color: var(--texto-2); font-weight: 650; }
.ficha-cuando { display: flex; align-items: flex-start; gap: 8px; color: var(--texto-2); font-size: 15px; }
.ficha-cuando .ic { width: 18px; height: 18px; margin-top: 2px; color: var(--texto-3); }
.ficha-acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.ficha-acciones .btn { flex: 1 1 140px; }
@media (min-width: 640px) { .ficha-acciones .btn { flex: 0 0 auto; } }
.ficha-cuerpo { display: grid; gap: 16px; }
.ficha-col { display: grid; gap: 16px; align-content: start; min-width: 0; }
.ficha-col > div[id] { scroll-margin-top: calc(var(--cabecera) + 16px); }
@media (min-width: 1000px) {
  .ficha-cab h1 { font-size: 28px; }
  .ficha-cuerpo { grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); align-items: start; }
}
.ficha-final { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 16px; padding: 4px 0 8px; }

/* ---------- Ficha: pasos ---------- */
.ficha-pasos .tarjeta-cab { margin-bottom: 4px; }
.pasos-barra { flex: none; width: 92px; height: 8px; border-radius: 999px; background: var(--borde); overflow: hidden; }
.pasos-barra i { display: block; height: 100%; border-radius: inherit; background: var(--lima); }
.pasos-lista { position: relative; list-style: none; margin: 0 -6px; padding: 0; }
.pasos-lista::before { content: ''; position: absolute; left: 19px; top: 22px; bottom: 22px; width: 2px; background: var(--borde); }
.paso button {
  position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: start; width: 100%;
  padding: 9px 6px; border: 0; border-radius: 12px; background: none; text-align: left; cursor: pointer; color: inherit;
}
.paso button:hover { background: var(--fondo); }
.paso-marca {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--borde-2);
  background: var(--superficie); color: var(--texto-3);
}
.paso-marca .ic { width: 15px; height: 15px; stroke-width: 2.6; }
.paso.hecho .paso-marca { background: var(--verde); border-color: var(--verde); color: #fff; }
.paso.vencido .paso-marca { background: var(--rojo); border-color: var(--rojo); color: #fff; }
.paso.proximo .paso-marca { background: var(--ambar-suave); border-color: var(--ambar); color: var(--ambar); }
.paso.omitido .paso-marca { border-style: dashed; }
.paso-texto { display: grid; gap: 1px; min-width: 0; padding-top: 3px; }
.paso-texto b { font-size: 15px; }
.paso-texto small { color: var(--texto-2); font-size: 13px; line-height: 1.35; }
.paso.omitido .paso-texto { opacity: .65; }
.paso-lado { display: grid; justify-items: end; gap: 3px; padding-top: 3px; }
.paso-lado small { font-size: 12px; font-weight: 650; color: var(--texto-3); white-space: nowrap; }
.paso.vencido .paso-lado small { color: var(--rojo); }
.paso.proximo .paso-lado small { color: var(--ambar); }

/* ---------- Ficha: secciones ---------- */
.datos-ficha { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 0; }
.dato-ficha { min-width: 0; }
.dato-ficha.ancho { grid-column: 1 / -1; }
.dato-ficha dt { font-size: 12px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: var(--texto-3); }
.dato-ficha dd { margin: 2px 0 0; font-weight: 650; overflow-wrap: anywhere; }
.dato-ficha dd small { display: block; font-weight: 500; color: var(--texto-3); font-size: 13px; }
.precios-ficha { display: flex; flex-wrap: wrap; gap: 4px 14px; font-weight: 500; color: var(--texto-2); }
.precios-ficha b { color: var(--texto); font-weight: 750; }
.notas-ficha { white-space: pre-line; font-weight: 500; }
.razones { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--fondo); font-size: 14px; }
.razones ul { margin: 6px 0 0; padding-left: 18px; color: var(--texto-2); display: grid; gap: 3px; }

.fila-logo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fila-logo .crece small { font-size: 13px; }
.logo-patrocinador {
  flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; overflow: hidden;
  background: var(--fondo); border: 1px solid var(--borde); color: var(--navy); font-weight: 800;
}
.logo-patrocinador.grande { width: 56px; height: 56px; border-radius: 14px; font-size: 20px; }
.logo-patrocinador.vacio { color: var(--texto-3); }
.logo-patrocinador img { width: 100%; height: 100%; object-fit: contain; padding: 4px; background: #fff; }
.premios-lista { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.premios-lista li { display: flex; gap: 10px; align-items: baseline; }
.premios-lista li > span:last-child { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.premio-puesto { flex: none; min-width: 42px; padding: 2px 8px; border-radius: 8px; background: var(--navy); color: #fff; font-weight: 800; font-size: 13px; text-align: center; }
.premio-articulo { font-weight: 650; }
.premio-articulo small { color: var(--texto-3); font-weight: 600; }
.artes-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.artes-mini a { display: grid; gap: 4px; color: var(--texto-2); text-decoration: none; font-size: 12.5px; font-weight: 650; }
.artes-mini img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; border: 1px solid var(--borde); background: var(--fondo); }

.cupo { display: grid; gap: 6px; }
.cupo-numeros { display: flex; align-items: baseline; gap: 8px; }
.cupo-numeros b { font-size: 30px; font-weight: 800; color: var(--navy); letter-spacing: -.02em; line-height: 1; }
.cupo-numeros span { color: var(--texto-2); font-weight: 600; }
.cupo-barra { position: relative; height: 10px; border-radius: 999px; background: var(--borde); }
.cupo-barra i { display: block; height: 100%; border-radius: inherit; background: var(--verde); }
.cupo-barra.bajo i { background: var(--ambar); }
.cupo-minimo { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1px; border-radius: 2px; background: var(--navy); }
.mini-lista { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; color: var(--texto-2); font-size: 14.5px; }
.mini-lista li { display: flex; gap: 10px; align-items: flex-start; }
.mini-lista .ic { width: 18px; height: 18px; margin-top: 2px; color: var(--texto-3); }

.historial { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 4px 16px; }
.historial summary { cursor: pointer; padding: 12px 0; font-weight: 700; color: var(--texto-2); }
.historial ul { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.historial li { display: grid; gap: 1px; font-size: 14px; }
.historial li small { color: var(--texto-3); font-size: 12.5px; }

/* ---------- Hojas: patrocinio y datos ---------- */
.hoja-evento { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--fondo); }
.hoja-evento small { color: var(--texto-3); font-size: 13px; }
.fila-patrocinador { display: flex; gap: 8px; align-items: flex-end; }
.fila-patrocinador .btn { min-height: 48px; }
.caja-nuevo { display: grid; gap: 12px; padding: 14px; border-radius: 14px; border: 1.5px dashed var(--borde-2); background: var(--fondo); }
.caja-nuevo .fila { justify-content: flex-end; }
.boton-logo { flex: none; }
.premios { display: grid; gap: 12px; }
.premio-lugar { display: grid; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--borde); background: var(--fondo); }
.premio-cab { display: flex; align-items: center; gap: 10px; }
.premio-cab b { flex: 1; font-size: 15px; color: var(--navy); }
.marca-cu { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--texto-2); cursor: pointer; min-height: 36px; }
.marca-cu input { width: 18px; height: 18px; accent-color: var(--navy); }
.premio-item { display: grid; grid-template-columns: minmax(0, 1fr) 104px auto; gap: 6px; align-items: center; }
.premio-item .entrada { min-height: 44px; padding: 9px 11px; background: var(--superficie); }
.premio-valor { position: relative; display: block; }
.premio-valor span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--texto-3); font-size: 14px; font-weight: 650; pointer-events: none; }
.premio-valor .entrada { padding-left: 34px; }
.premio-lugar > .btn { justify-self: start; }
.premios > .btn { justify-self: start; }
.nombre-auto { padding: 11px 13px; border-radius: var(--radio-s); background: var(--fondo); color: var(--texto-2); font-weight: 650; }

/* ---------- Patrocinios ---------- */
.pat-lista { display: flex; flex-direction: column; }
.pat-fila {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border: 0; background: none; text-align: left; cursor: pointer; color: inherit;
}
.pat-fila + .pat-fila { border-top: 1px solid var(--borde); }
.pat-fila:hover { background: var(--fondo); }
.pat-fila > .ic { color: var(--texto-3); width: 18px; height: 18px; flex: none; }
.pat-limite {
  flex: none; width: 82px; display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; text-align: center;
  background: var(--fondo); color: var(--texto-2); font-size: 12px; font-weight: 750; line-height: 1.2;
}
.pat-limite .ic { width: 18px; height: 18px; }
.pat-limite.rojo { background: var(--rojo-suave); color: var(--rojo); }
.pat-limite.ambar { background: var(--ambar-suave); color: var(--ambar); }
.pat-texto { display: grid; gap: 4px; flex: 1; min-width: 0; }
.pat-texto b { font-size: 15px; line-height: 1.3; }
.pat-texto small { color: var(--texto-2); font-size: 13px; }

/* ---------- Ajustes ---------- */
.pestanas {
  display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  position: sticky; top: var(--cabecera); z-index: 20; background: linear-gradient(var(--fondo) 85%, rgba(244, 246, 248, 0));
}
.pestanas::-webkit-scrollbar { display: none; }
.pestanas button {
  flex: none; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--borde); background: var(--superficie);
  color: var(--texto-2); font-weight: 700; font-size: 14px; white-space: nowrap; cursor: pointer;
}
.pestanas button.activa { background: var(--navy); border-color: var(--navy); color: #fff; }
@media (min-width: 900px) { .pestanas { position: static; margin: 0; padding: 0; flex-wrap: wrap; background: none; } }
.pestana-cuerpo { display: grid; gap: 14px; }
.aj-barra { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.aj-barra p { flex: 1 1 240px; font-size: 15px; }
.aj-lista { display: flex; flex-direction: column; }
.aj-fila {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 16px; border: 0; background: none;
  text-align: left; cursor: pointer; color: inherit;
}
.aj-fila.fija { cursor: default; }
.aj-fila + .aj-fila { border-top: 1px solid var(--borde); }
button.aj-fila:hover { background: var(--fondo); }
.aj-fila > .ic { color: var(--texto-3); width: 18px; height: 18px; flex: none; }
.aj-fila.apagada .aj-fila-texto { opacity: .55; }
.aj-fila .avatar { box-shadow: none; cursor: inherit; }
.aj-fila-texto { display: grid; gap: 2px; flex: 1; min-width: 0; }
.aj-fila-texto b { font-size: 15px; line-height: 1.3; }
.aj-fila-texto small { color: var(--texto-2); font-size: 13.5px; }
.aj-fila-texto .fila { margin-top: 3px; gap: 6px; }
.aj-fila-texto .fila:empty { display: none; }
.codigo {
  flex: none; min-width: 46px; padding: 6px 6px; border-radius: 10px; background: var(--navy-suave); color: var(--navy);
  font-weight: 800; font-size: 13px; text-align: center; letter-spacing: .02em;
}
.relleno-lista { padding: 16px; }
.tarjeta-cab + .relleno-lista { padding-top: 0; }
.combinaciones { display: grid; gap: 8px; }
.combinacion { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.combinacion > span { font-weight: 800; color: var(--texto-3); }
.combinaciones > .btn { justify-self: start; }
.aj-rejilla { display: grid; gap: 14px; }
@media (min-width: 1000px) { .aj-rejilla { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.aj-campos { display: grid; gap: 0 24px; }
@media (min-width: 640px) { .aj-campos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.campo-linea {
  display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 6px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--borde);
}
.campo-linea > span { font-size: 14.5px; font-weight: 650; color: var(--texto-2); line-height: 1.3; }
.campo-linea .entrada { min-height: 44px; padding: 9px 11px; }
.campo-linea.media { grid-template-columns: minmax(0, 1fr) 150px; }
.campo-linea.ancha { grid-template-columns: 1fr; grid-column: 1 / -1; }
.campo-linea.fila { grid-column: 1 / -1; }
.aj-campos .campo-linea:last-child { border-bottom: 0; }
.aj-estado { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 14px; font-weight: 650; color: var(--texto-2); }
.aj-estado .etiqueta { white-space: normal; }
.precios-tabla { display: grid; gap: 8px; }
.precios-fila { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 36px; gap: 6px 8px; align-items: center; }
.precios-fila.cab { font-size: 12px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: var(--texto-3); }
.precios-fila.cab > span:first-child { display: none; }
.precios-sede { grid-column: 1 / -1; font-weight: 700; font-size: 14px; color: var(--texto-2); margin-top: 4px; }
.precio-celda { position: relative; display: block; }
.precio-celda small { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--texto-3); font-size: 13px; font-weight: 650; pointer-events: none; }
.precio-celda .entrada { min-height: 44px; padding: 9px 8px 9px 32px; }
@media (min-width: 640px) {
  .precios-fila { grid-template-columns: minmax(120px, 1.2fr) repeat(3, minmax(0, 1fr)) 36px; }
  .precios-fila.cab > span:first-child { display: block; }
  .precios-sede { grid-column: auto; margin: 0; }
}
