/* ── Sora, empaquetada con el producto ─────────────────────
   NO se pide a Google Fonts. Dos motivos, y el primero es que no funcionaba:
   el CSP de index.html es `style-src 'self' 'unsafe-inline'`, así que el navegador
   rechazaba la hoja de fonts.googleapis.com y la interfaz caía a Segoe UI sin avisar.
   Y aunque el CSP lo permitiera: esto corre en el PC de un club, y un PC sin internet
   —o con el dominio bloqueado— se quedaría igualmente sin la fuente de marca.
   Es la misma familia variable que sirve Google (un fichero cubre todo el eje 100-800).
   Sora es OFL: se puede redistribuir. Licencia completa en fonts/OFL.txt. */
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('fonts/sora-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('fonts/sora-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================================
   Kortmind Panel — Rediseño visual (claro, moderno, estilo dashboard)
   - Tema claro, tarjetas blancas MUY redondeadas sobre un gris cálido, sin bordes ni
     sombras: la jerarquía la da el contraste blanco-sobre-gris. Todo lo que se pulsa
     es una píldora. Acento magenta de marca (#FF0066).
   - Barra lateral: un DOCK blanco que flota despegado de los bordes (estilo Dock de
     macOS/iPadOS), no una columna pegada al lateral. Plegado enseña solo los iconos y
     se abre al pasar el cursor. Era oscura; se pasó a blanca para que el panel entero
     sea una sola familia de superficies, sin un bloque negro al lado.
   - Iconos de canal (WhatsApp / email) estilo iOS: SVG inline en panel.js
   - El panel se monta a pantalla completa (position:fixed) para no depender
     del layout del tema de WordPress que lo embebe.
   ========================================================================== */

:root {
  --bg:         #efefed;   /* gris cálido: es lo que hace flotar lo blanco */
  --card:       #ffffff;
  --ink:        #121212;
  --ink-soft:   #3a4150;
  --muted:      #8e8e89;
  --line:       #e6e6e2;   /* para separadores finos, ya no para rodear tarjetas */
  --line-soft:  #f0f0ed;
  --fill:       #f4f4f1;   /* relleno de campos, chips y botones secundarios */
  --fill-hover: #e9e9e5;
  /* El dock: blanco, con su propio gris de reposo y su propio gris de texto. Siguen
     llamándose --sidebar* porque es lo que usa todo el subárbol de la barra. */
  --sidebar:    #ffffff;
  --sidebar-2:  #f1f1ee;
  --side-muted: #747470;   /* gris de reposo del dock: 4,7:1 sobre blanco, llega a AA */
  --acento:     #FF0066;
  --acento-osc: #C2004D;
  --green:      #22c55e;
  --green-soft: #dcfce7;
  --blue:       #0a84ff;
  --blue-soft:  #dbeafe;
  --orange:     #f97316;
  --red:        #ef4444;
  --violet:     #8b5cf6;
  --radius:     24px;
  --radius-sm:  14px;
  --pill:       999px;
  --shadow:     none;      /* plano a propósito; la sombra se reserva para el dock */
  --shadow-sm:  none;
  --font:       'Sora', -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#km-panel-container { position: static; }

/* ─────────────────────────────  LOGIN  ─────────────────────────────
   Pantalla de entrada partida en dos: a la izquierda la marca sobre negro con la lluvia, a la
   derecha el formulario sobre fondo claro.
   Por debajo de 900 px se apila: la marca se queda en una banda corta arriba y el formulario va
   debajo, con los MISMOS campos y las mismas medidas. Un solo diseño que mantener, no dos.
   La misma estructura la usan la pantalla de crear contraseña y el modal de recuperar. */
.km-login-screen {
  position: fixed; inset: 0; z-index: 99998;
  display: flex; flex-wrap: wrap;
  background: #FFFFFF;
  font-family: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
/* ── La mitad oscura ─────────────────────────────────────────────────── */
.km-login-marca {
  flex: 1 1 520px; min-width: 0; position: relative;
  background: #0A0A0A; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
/* El lienzo de la lluvia. Decorativo: va detrás de todo y no recibe ni un clic, para no robarle
   el foco a los campos ni tapar el botón en ningún tamaño. */
.km-login-rain { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
/* Y un velo por encima: sin él, los caracteres pasan por detrás de la marca y el logo se lee
   sobre un fondo que se mueve. */
.km-login-velo {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(640px 440px at 50% 50%, rgba(10,10,10,.92) 0%, rgba(10,10,10,.55) 58%, rgba(10,10,10,.18) 100%);
}
.km-login-brand { position: relative; z-index: 1; text-align: center; padding: 48px 32px; }
.km-login-logo-img { width: 380px; max-width: 78%; height: auto; display: block; margin: 0 auto 26px; }
/* Respaldo si el fichero del logo no carga: el símbolo del JS y el nombre en texto. */
.km-login-mark {
  width: 96px; height: 96px; border-radius: 21.6px; margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center; background: #FF0066;
}
.km-login-mark .kortmind-logo { width: 78%; height: 78%; display: block; }
.km-login-nombre { font-size: 44px; font-weight: 700; letter-spacing: -1px; color: #F7F6F4; margin-bottom: 10px; }
.km-login-lema { font-size: 20px; line-height: 1.5; color: #B8B8B8; max-width: 360px; margin: 0 auto; font-family: inherit; }

/* ── La mitad clara ──────────────────────────────────────────────────── */
/* `flex: 999` para que, cuando los dos quepan en una fila, el formulario se lleve el espacio
   sobrante: la marca no necesita crecer y el formulario sí respira mejor ancho. */
.km-login-form {
  flex: 999 1 460px; min-width: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 56px 32px; box-sizing: border-box;
}
.km-login-caja { width: 100%; max-width: 360px; }
.km-login-eyebrow {
  font-size: 12px; line-height: 1.2; font-weight: 600; letter-spacing: 1.8px;
  text-transform: uppercase; color: #C2004D; margin-bottom: 10px;
}
.km-login-tit {
  margin: 0 0 6px; font-size: 34px; line-height: 1.2; font-weight: 700;
  letter-spacing: -.8px; color: #141414; font-family: inherit;
}
.km-login-sub { margin: 0 0 26px; font-size: 15px; line-height: 1.5; color: #4D4D4D; font-family: inherit; }

.km-login-screen .km-form-group { margin-bottom: 16px; }
.km-login-screen .km-form-group label {
  display: block; font-size: 13px; line-height: 1.45; font-weight: 600; margin-bottom: 6px;
  color: #141414; text-transform: none; letter-spacing: 0; font-family: inherit;
}
.km-login-screen .km-form-group input {
  width: 100%; box-sizing: border-box; height: 46px; padding: 0 14px;
  border: 1px solid #D9D5D0; border-radius: 8px;
  background: #FFFFFF; color: #141414; font-size: 16px; font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
/* 16px y no menos: por debajo de eso, Safari en iPhone hace zoom al tocar el campo y descoloca
   la pantalla entera. */
.km-login-screen .km-form-group input::placeholder { color: #8A8A8A; }
.km-login-screen .km-form-group input:focus {
  outline: none; border-color: #FF0066; box-shadow: 0 0 0 4px rgba(255,0,102,.18);
}
.km-pass-wrap { position: relative; }
.km-pass-wrap input { padding-right: 46px !important; }
.km-pass-eye {
  position: absolute; right: 3px; top: 3px; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: none !important; border: none !important; box-shadow: none !important;
  border-radius: 8px; cursor: pointer; color: #4D4D4D !important; padding: 0;
}
.km-pass-eye:hover { color: #141414 !important; background: #F7F6F4 !important; }
.km-pass-eye svg { width: 18px; height: 18px; }
.km-remember {
  display: flex; align-items: center; gap: 9px; font-size: 14px; color: #4D4D4D;
  margin: 2px 0 22px; cursor: pointer; user-select: none; font-family: inherit;
}
.km-remember input { width: 16px; height: 16px; accent-color: #FF0066; cursor: pointer; margin: 0; }
/* «Entrar» en magenta: es el botón principal de la marca y lo único que tiene que saltar a la vista.
   ⚠️ 19px en negrita, no 18: el blanco sobre magenta da 3,9:1, y eso solo vale a partir de
   18,66px en negrita (14pt). Dieciocho se queda justo por debajo del mínimo legible. */
.km-login-btn {
  width: 100%; height: 48px; padding: 0 20px; display: block;
  /* 12px, que es el radio de botón del sistema de marca y el mismo que usa el candado del bot.
     En el ajuste de tamaños lo bajé a 10 junto con todo lo demás y quedó de esquinas duras: el
     radio no escala con el alto, es un valor del sistema y se queda donde está. */
  background: #FF0066; color: #fff; border: 1px solid #FF0066; border-radius: 12px;
  font-size: 19px; font-weight: 700; letter-spacing: .2px; cursor: pointer; font-family: inherit;
  transition: background .2s, box-shadow .2s;
}
.km-login-btn:hover:not(:disabled) { background: #C2004D; border-color: #C2004D; }
.km-login-btn:disabled { opacity: .6; cursor: not-allowed; }
.km-login-ayuda { margin: 18px 0 0; text-align: center; font-size: 14px; line-height: 1.5; font-family: inherit; }
/* ⚠️ Gris y subrayado, NO magenta. Es la misma decisión que en la pantalla de bloqueo del bot:
   en esta pantalla solo puede haber una cosa que llame, y es «Entrar». Un enlace magenta y en
   negrita justo debajo del botón magenta compite con él, y quien entra a diario —que es casi
   todo el mundo— acaba leyendo dos veces para saber cuál es cuál.
   El magenta se reserva para el paso por encima: ahí sí, porque ya estás apuntando a él.
   El gris es #4D4D4D y no uno más claro porque a 14px hace falta 4,5:1 sobre blanco. */
.km-login-ayuda a { color: #4D4D4D !important; font-weight: 400; cursor: pointer; text-decoration: underline !important; }
.km-login-ayuda a:hover { color: #FF0066 !important; }

/* ── Apilado: móvil y ventanas estrechas ─────────────────────────────── */
@media (max-width: 900px) {
  .km-login-screen { flex-direction: column; overflow-y: auto; display: block; }
  /* Banda corta: lo justo para que se reconozca la marca sin empujar el botón fuera de pantalla. */
  .km-login-marca { flex: none; height: 252px; min-height: 252px; }
  .km-login-logo-img { width: 210px; max-width: 70%; margin-bottom: 18px; }
  .km-login-brand { padding: 0 24px; }
  .km-login-lema { font-size: 16px; }
  .km-login-mark { width: 64px; height: 64px; border-radius: 14.4px; margin-bottom: 14px; }
  .km-login-nombre { font-size: 25px; }
  /* ⚠️ El velo, más pequeño. En escritorio son 640×440 px sobre media pantalla, y ahí deja los
     bordes despejados; sobre una banda de 252 px de alto ese mismo óvalo la cubre ENTERA a casi
     plena opacidad y se come la lluvia — que es justo lo reportado: «en móvil se ve poco el
     efecto matrix». Aquí se ajusta a la banda: oscuro donde está el logo, despejado en los lados. */
  .km-login-velo {
    background: radial-gradient(260px 150px at 50% 50%, rgba(10,10,10,.90) 0%, rgba(10,10,10,.55) 60%, rgba(10,10,10,.05) 100%);
  }
  .km-login-form { padding: 28px 22px 24px; display: block; }
  .km-login-caja { margin: 0 auto; }
  .km-login-tit { font-size: 27px; letter-spacing: -.5px; }
  .km-login-sub { font-size: 14px; margin-bottom: 20px; }
  .km-login-screen .km-form-group { margin-bottom: 14px; }
  .km-login-screen .km-form-group input { height: 44px; }
  .km-login-btn { height: 46px; }
}

/* ─────────────────────  RECUPERAR CONTRASEÑA (modal)  ───────────────── */
/* Va sobre TODA la pantalla, no solo sobre la mitad del formulario: así es el mismo modal en
   escritorio y en móvil y no hay que mantener dos. */
.km-rec-fondo {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(10,10,10,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; box-sizing: border-box;
  font-family: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.km-rec-caja {
  position: relative; width: 100%; max-width: 440px; box-sizing: border-box;
  background: #FFFFFF; border: 1px solid #E6E3DF; border-radius: 20px;
  padding: 32px; box-shadow: 0 24px 64px rgba(10,10,10,.35);
  max-height: 92vh; overflow-y: auto;
}
.km-rec-x {
  position: absolute; top: 16px; right: 16px; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: none !important; border: none !important; box-shadow: none !important;
  border-radius: 8px; cursor: pointer; color: #4D4D4D !important; font-size: 16px; padding: 0;
}
.km-rec-x:hover { background: #F7F6F4 !important; color: #141414 !important; }
/* El mismo lenguaje de la marca (cuadrado redondeado) en pequeño, para que el modal se lea como
   parte del panel y no como un cartel del navegador. */
.km-rec-icono {
  width: 48px; height: 48px; margin-bottom: 20px; border-radius: 10.8px;
  background: #FFE8F0; display: flex; align-items: center; justify-content: center; color: #C2004D;
}
.km-rec-icono svg { width: 24px; height: 24px; }
.km-rec-caja h2 {
  margin: 0 0 8px; font-size: 28px; line-height: 1.25; font-weight: 700;
  letter-spacing: -.5px; color: #141414; font-family: inherit;
}
.km-rec-sub { margin: 0 0 24px; font-size: 16px; line-height: 1.5; color: #4D4D4D; font-family: inherit; }
.km-rec-caja .km-form-group { margin-bottom: 24px; }
.km-rec-caja .km-form-group label {
  display: block; font-size: 14px; line-height: 1.45; font-weight: 600; margin-bottom: 8px;
  color: #141414; text-transform: none; letter-spacing: 0; font-family: inherit;
}
.km-rec-caja .km-form-group input {
  width: 100%; box-sizing: border-box; height: 52px; padding: 0 16px;
  border: 1px solid #D9D5D0; border-radius: 8px;
  background: #FFFFFF; color: #141414; font-size: 16px; font-family: inherit;
}
.km-rec-caja .km-form-group input:focus { outline: none; border-color: #FF0066; box-shadow: 0 0 0 4px rgba(255,0,102,.18); }
/* La respuesta no puede decir si ese usuario existe (eso regalaría la lista de cuentas válidas),
   así que el aviso es el mismo siempre y hay que explicarlo aquí para que nadie lo lea como fallo. */
.km-rec-nota { margin: 16px 0 0; font-size: 13px; line-height: 1.45; color: #8A8A8A; font-family: inherit; }

/* ─────────────────────  CREAR CONTRASEÑA (desde el correo)  ─────────── */
.km-cc-fuerza { display: flex; gap: 6px; margin-top: 10px; }
.km-cc-fuerza i { flex: 1; height: 4px; border-radius: 2px; background: #E6E3DF; transition: background .2s; }
.km-cc-fuerza i.on { background: #FF0066; }
.km-cc-regla { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: #4D4D4D; font-family: inherit; }
.km-cc-regla strong { color: #C2004D; }
/* El estado que SIEMPRE se olvida y el que más se ve: el enlace caducado. Si no está diseñado, el
   club se queda con un «token inválido» en crudo y acaba llamando por teléfono. */
.km-cc-caduca {
  margin-top: 32px; padding: 16px; font-size: 14px; line-height: 1.5; color: #4D4D4D;
  border: 1px solid #E6E3DF; border-left: 3px solid #FF0066; border-radius: 12px; background: #F7F6F4;
  font-family: inherit;
}

.km-error {
  background: rgba(255,59,48,.10); border: 1px solid rgba(255,59,48,.28);
  border-radius: 12px; padding: 11px 14px; color: #c1271d; font-size: 13.5px;
  margin-bottom: 16px;
}
/* El mismo recuadro en verde. «Te hemos mandado el enlace» y «ya puedes entrar» son buenas
   noticias: darlas en el recuadro rojo de los errores las hace parecer un fallo. */
.km-ok {
  background: rgba(46,204,113,.12); border: 1px solid rgba(46,204,113,.35);
  border-radius: 12px; padding: 11px 14px; color: #1b5e20; font-size: 13.5px;
  margin-bottom: 16px;
}

/* ─────────────────────────────  APP SHELL  ───────────────────────────── */
/* En móvil, cualquier elemento más ancho que la pantalla ensancha el "layout viewport" de Safari y
   ENCOGE toda la app (se ve a media pantalla y hay que tocar para que ocupe el ancho). Cortamos el
   desbordamiento horizontal de raíz. Este CSS solo se carga en la página del panel, así que es seguro. */
html, body { max-width: 100%; overflow-x: hidden; }
/* La columna reservada = ancho del dock + sus dos márgenes (16 + 72 + 16). */
.km-app {
  position: fixed; inset: 0; z-index: 99998;
  display: grid; grid-template-columns: 104px 1fr;
  background: var(--bg); overflow: hidden;
  transition: grid-template-columns .22s cubic-bezier(.4, 0, .2, 1);
}
/* Al abrir el dock (hover), la columna crece y EMPUJA el contenido (lo encoge) en vez de taparlo. */
.km-app:has(.km-sidebar:hover) { grid-template-columns: 272px 1fr; }

/* Dock: panel blanco flotante, despegado de los tres bordes. Plegado solo enseña los
   iconos; al pasar el cursor crece hacia la derecha y aparecen las etiquetas.
   `overflow-x: hidden` NO es cosmético: es lo que recorta las etiquetas mientras está
   plegado. Si se pone en visible, los textos se salen por encima del contenido. */
.km-sidebar {
  background: var(--sidebar);
  display: flex; flex-direction: column;
  padding: 14px 12px; gap: 4px;
  position: fixed; top: 16px; left: 16px; bottom: 16px; width: 72px; z-index: 60;
  border-radius: 28px;
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
  /* ⚠️ El rail NO scrollea: lo hace su lista de secciones (.km-nav). Cuando scrolleaba entero,
     con la ventana baja aparecía la barra del sistema —gris, ancha— DENTRO del rail redondeado,
     pisándole las esquinas, y además se iban con el scroll el club, el idioma y el salir, que
     acababan cortados por abajo. Ahora la marca se queda arriba, el pie abajo y solo se mueve la
     lista del medio. */
  overflow: hidden;
  transition: width .22s cubic-bezier(.4, 0, .2, 1), box-shadow .22s ease;
}
.km-brand { flex: none; }
.km-sidebar:hover { width: 240px; box-shadow: 0 10px 38px rgba(0,0,0,.12); }
/* Etiquetas: ocultas en el rail, aparecen al abrir (fade). */
/* ⚠️ `opacity: 0` esconde pero NO quita sitio, y eso era lo que descentraba el pie: el nombre del
   club y el del idioma seguían ocupando su ancho dentro de una fila `justify-content: center`, así
   que empujaban el avatar y la bandera a la izquierda. Se veía como «no está centrado» y no había
   forma de arreglarlo tocando el centrado, porque el centrado ya era correcto.
   Con `max-width: 0` + `overflow: hidden` dejan de medir cuando están ocultas, y al abrir el rail
   recuperan su ancho — animado, que es para lo que estaba la opacidad. */
.km-brand-name, .km-brand-sub, .km-nav-item span,
.km-club-name, .km-club-role, .km-logout-link span, #km-club-menu,
.km-lang-link span, #km-lang-menu {
  white-space: nowrap; opacity: 0; max-width: 0; overflow: hidden;
  transition: opacity .16s ease, max-width .22s ease;
}
.km-sidebar:hover .km-brand-name, .km-sidebar:hover .km-brand-sub,
.km-sidebar:hover .km-nav-item span, .km-sidebar:hover .km-club-name,
.km-sidebar:hover .km-club-role, .km-sidebar:hover .km-logout-link span,
.km-sidebar:hover #km-club-menu,
.km-sidebar:hover .km-lang-link span, .km-sidebar:hover #km-lang-menu { opacity: 1; }
.km-sidebar:hover .km-brand-name, .km-sidebar:hover .km-brand-sub,
.km-sidebar:hover .km-nav-item span, .km-sidebar:hover .km-club-name,
.km-sidebar:hover .km-club-role, .km-sidebar:hover .km-logout-link span,
.km-sidebar:hover #km-club-menu,
.km-sidebar:hover .km-lang-link span, .km-sidebar:hover #km-lang-menu { max-width: 180px; }
.km-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 2px 5px 14px;
}
/* EL RADIO DEL FAVICON, que es el de la marca: `rx="22.5"` sobre 100×100 en
   `marca/logo/05_favicon/favicon.svg`, o sea el 22,5% del lado. Se escribe en porcentaje y no en
   píxeles a propósito: así sigue siendo el mismo si algún día cambia el tamaño del cuadro.
   (Primero estaba en 14 px —37%—, lo subí a 17 —45%— por «más redondeo» y quedó casi un círculo.
   El valor bueno no era ninguno de los dos: era el del favicon, que es más CUADRADO que los dos.) */
.km-brand-mark {
  width: 38px; height: 38px; border-radius: 22.5%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: #FF0066; overflow: hidden;
}
.km-brand-mark .kortmind-logo { width: 84%; height: 84%; display: block; }
.km-brand-name { color: var(--ink); font-weight: 700; font-size: 16px; letter-spacing: -.2px; }
.km-brand-sub  { color: var(--side-muted); font-size: 11.5px; }

/* `min-height: 0` es imprescindible: sin él, un hijo flexible no puede encoger por debajo de su
   contenido y la lista empujaría el pie fuera del rail en vez de scrollear. */
.km-nav {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
  /* Sin barra visible: en un rail de 72 px de ancho y esquinas de 28, la barra del sistema es un
     pegote gris que se come el diseño. Se sigue pudiendo mover con la rueda y con el teclado. */
  scrollbar-width: none; -ms-overflow-style: none;
}
.km-nav::-webkit-scrollbar { width: 0; height: 0; }
/* ⚠️ `padding: 0 14px` PLEGADO, no 12, y no es un número arbitrario: la caja interior del rail mide
   48 (72 de ancho menos 12+12 de padding), así que su eje está en 24. Un icono de 20 centrado ahí
   empieza en 14. Con los 12 de antes el icono quedaba en el eje 22 — dos píxeles a la izquierda del
   logo de la marca, que sí está centrado (padding 5 + 38/2 = 24), y del avatar del club.
   Dos píxeles no se ven mirando un icono; se ven mirando la COLUMNA, porque la marca de arriba y el
   pie de abajo caen en un eje y los seis iconos del medio en otro. Abierto se vuelve a 12 + gap 12,
   que es la separación de siempre entre icono y etiqueta. */
.km-nav-item {
  display: flex; align-items: center; gap: 0;
  padding: 0 14px; height: 46px; border-radius: 16px; cursor: pointer;
  color: var(--side-muted); font-size: 14.5px; font-weight: 500; white-space: nowrap;
  border: none; background: none; width: 100%; text-align: left;
  font-family: inherit; transition: background .15s, color .15s;
}
.km-nav-item svg { width: 20px; height: 20px; flex: none; }
.km-sidebar:hover .km-nav-item { gap: 12px; padding: 0 12px; }
.km-nav-item:hover { background: var(--sidebar-2); color: #d5dae2; }
.km-nav-item.active { background: var(--acento); color: #fff; font-weight: 600; }
.km-nav-item.active svg { stroke: #fff; }
.km-nav-badge {
  margin-left: auto; background: rgba(255,255,255,.14); color: #fff;
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 20px;
}
.km-nav-item.active .km-nav-badge { background: rgba(255,255,255,.22); color: #fff; }
/* ⚠️ Los 12 px de los lados son los MISMOS que los del rail (`.km-sidebar`): antes eran 6, y por
   eso el avatar del club y la bandera salían 6 px a la izquierda de la columna de iconos de
   arriba. Era eso lo que se veía descentrado, no el avatar en sí. */
/* La zona de abajo —club, idioma y salir— va sobre un gris propio, de una pieza. Antes el chip del
   club llevaba su tarjeta y el resto no, y ese recuadro suelto era lo que desentonaba. Así se
   separa del menú sin tres fondos distintos. */
/* De BORDE A BORDE, no una tarjeta: los márgenes negativos cancelan el padding del rail
   (`14px 12px`) y el gris llega hasta los lados. Las esquinas de abajo no hace falta redondearlas
   aquí — el propio rail tiene `overflow: hidden` y su radio de 28, así que lo recorta él. */
.km-side-foot {
  flex: none; margin: auto -12px -14px; padding: 10px 12px 14px;
  background: var(--sidebar-2);
}
/* El chip del club. PLEGADO (el rail estrecho) no lleva tarjeta: con el nombre oculto, el fondo
   quedaba como un recuadro suelto alrededor de un avatar, descentrado respecto a la columna de
   iconos de arriba — que es lo que desentonaba. Abierto sí la lleva: ahí el fondo agrupa el avatar
   con el nombre y el «cambiar de club», y sin él las tres cosas flotan.
   El centrado se hace con `justify-content`, no con márgenes: el avatar mide 32 y la columna 48. */
/* ⚠️ `gap: 0` plegado, y aquí está la razón de que esto siguiera sin centrarse después de dos
   intentos: una etiqueta con `max-width: 0` ya no mide, pero SIGUE SIENDO UN ELEMENTO FLEX, así
   que el hueco entre ella y el icono se sigue reservando. Con `gap: 10px` el contenido medía
   32 + 10 y el centrado dejaba el icono cinco píxeles a la izquierda — justo lo que se veía al
   compararlo con los iconos del menú, que no tienen hueco que reservar. */
.km-club-chip {
  display: flex; align-items: center; justify-content: center; gap: 0;
  padding: 6px 0; border-radius: 16px; margin-bottom: 4px;
}
/* Los 12 px de los lados son los MISMOS que los del menú de arriba (`.km-nav-item` abierto), para
   que abierta las seis filas arranquen en la misma vertical. Con 8 el club, el idioma y el salir
   empezaban cuatro píxeles a la izquierda de las secciones. */
.km-sidebar:hover .km-club-chip { justify-content: flex-start; gap: 10px; padding: 6px 12px; }
.km-sidebar:hover .km-lang-link { justify-content: flex-start; gap: 9px; padding: 9px 12px; }
.km-sidebar:hover .km-logout-link { justify-content: flex-start; gap: 9px; padding: 9px 12px; }
.km-club-avatar {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg,#3b82f6,#8b5cf6); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
/* Plegado NO crece: así el chip tiene hueco libre que repartir y el avatar cae en el eje. Abierto
   sí, que es cuando hay nombre que recortar con el `min-width: 0`. */
.km-club-txt { min-width: 0; }
.km-sidebar:hover .km-club-txt { flex: 1; }
.km-club-name { color: var(--ink); font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.km-club-role { color: var(--side-muted); font-size: 11px; }
/* Selector de idioma. Misma forma que «Cerrar sesión» para que el pie se lea como una sola lista,
   y la bandera ocupando el sitio del icono: plegado el rail solo enseña eso, y es lo único de esta
   zona que se entiende sin etiqueta al lado. */
/* ⚠️ PLEGADO NO SE VE. El pie del rail estrecho enseña SOLO el club, que es lo único que se
   entiende sin etiqueta; el idioma y el salir aparecen al abrir la barra. Antes estaban los tres y
   al desplegar se movían los tres a la vez —cada uno su distancia, porque cada uno tiene su icono y
   su ancho—, y eso era el baile que se veía. Apareciendo al abrir no se mueven: no estaban.
   `display: none` y no `visibility`/`opacity` a propósito: tienen que dejar de ocupar, o el hueco
   vacío queda ahí debajo del club. */
.km-lang-link { display: none; }
.km-sidebar:hover .km-lang-link { display: flex; }
.km-lang-link {
  align-items: center; justify-content: center; gap: 0; width: 100%;
  padding: 9px 0; border: none; background: none; cursor: pointer;
  color: var(--side-muted); font-size: 13px; font-family: inherit; border-radius: 16px;
  text-align: left;
}
.km-lang-link:hover { background: var(--sidebar-2); color: var(--ink); }
.km-lang-link > span:first-of-type { flex: 1; min-width: 0; white-space: nowrap; }
/* La flecha se va con la etiqueta, no se queda sola. Plegado la fila solo enseña la bandera, y una
   flecha de 7 px al lado desplazaba la bandera media flecha a la izquierda del eje. `display: none`
   y no `opacity: 0` a propósito: lo que descentra es que OCUPE, no que se vea. */
.km-lang-caret { font-size: 11px; opacity: .7; display: none; }
.km-sidebar:hover .km-lang-caret { display: inline; }
/* La bandera NO se encoge: es lo único visible con el rail plegado. Flexible, al recortarse el
   ancho se quedaría en una raya de color sin forma reconocible. */
.km-flag {
  width: 20px; height: 14px; flex: none; border-radius: 3px; display: block;
  box-shadow: 0 0 0 1px rgba(0,0,0,.12) inset;
}
.km-lang-menu { background: var(--sidebar-2); border-radius: 14px; margin-bottom: 6px; overflow: hidden; padding: 4px; }
.km-lang-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 9px; border: 0; background: none; cursor: pointer; border-radius: 10px;
  color: var(--ink); font-size: 13px; font-family: inherit; text-align: left; white-space: nowrap;
}
.km-lang-item:hover { background: rgba(0,0,0,.05); }
.km-lang-item.on { color: var(--acento); font-weight: 700; }

/* Menú de «cambiar de club». Estaba pintado con `style="..."` dentro del JS, y un estilo en línea
   NO puede llevar `:hover` — por eso no lo tenía: no es que se perdiera, es que no cabía ahí. Al
   traerlo al CSS se queda además a juego con el de idioma, que vive dos píxeles más abajo: venía
   en oscuro (#1c1c1c) de cuando el dock era negro, y en un dock blanco cantaba. */
#km-club-menu {
  background: var(--sidebar-2); border-radius: 14px; margin-bottom: 6px;
  overflow: hidden; overflow-y: auto; max-height: 260px; padding: 4px;
}
.km-club-menu-item {
  display: block; width: 100%; text-align: left; white-space: nowrap;
  padding: 8px 9px; border: 0; background: none; cursor: pointer; border-radius: 10px;
  color: var(--ink); font-size: 13px; font-family: inherit;
}
.km-club-menu-item:hover { background: rgba(0,0,0,.05); }
.km-club-menu-item.on { color: var(--acento); font-weight: 700; }

.km-logout-link { display: none; }
.km-sidebar:hover .km-logout-link { display: flex; }
.km-logout-link {
  align-items: center; justify-content: center; gap: 0; width: 100%;
  padding: 9px 0; border: none; background: none; cursor: pointer;
  color: var(--side-muted); font-size: 13px; font-family: inherit; border-radius: 16px;
}
.km-logout-link:hover { background: var(--sidebar-2); color: var(--ink); }
.km-logout-link svg { width: 17px; height: 17px; }

/* Main scroll area (columna 2; la 1 es el hueco del rail de 76px) */
.km-main { grid-column: 2; overflow-y: auto; overflow-x: hidden; padding: 22px 26px 60px; min-width: 0; }

/* Cabecera móvil (hamburguesa) — oculta en escritorio */
.km-mobile-top { display: none; align-items: center; gap: 12px; padding: 11px 16px; background: var(--sidebar); color: var(--ink); border-bottom: 1px solid var(--line); }
.km-mobile-top .km-burger { background: none; border: 0; color: var(--ink); cursor: pointer; padding: 4px; display: flex; }
.km-mobile-top .km-burger svg { width: 24px; height: 24px; }
.km-mobile-top .km-mt-name { font-weight: 700; font-size: 15px; }
.km-backdrop { display: none; }

/* Topbar */
.km-topbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 22px;
}
.km-topbar h1 { font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
.km-topbar .km-sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.km-topbar-spacer { flex: 1; }
.km-demo-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff7d6; color: #92700a; border: 1px solid #f4e3a1;
  font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 20px;
}
.km-demo-badge::before { content:''; width:7px; height:7px; border-radius:50%; background:#eab308; }
.km-updated-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #eaf7e6; color: #2f7d20; border: 1px solid #cdeec2;
  font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 20px;
}
.km-updated-badge::before { content:''; width:7px; height:7px; border-radius:50%; background:#22c55e; }

.km-segment {
  display: inline-flex; background: var(--fill-hover); border-radius: var(--pill); padding: 4px;
}
.km-segment button {
  border: none; background: none; padding: 7px 16px; border-radius: var(--pill);
  font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; font-family: inherit;
  transition: all .15s;
}
.km-segment button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* Status pill (real bot status) */
.km-status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 22px; font-size: 13px; font-weight: 600;
  background: #fff; box-shadow: none; cursor: pointer; border: none;
}
.km-status-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd2da; }
.km-status-pill.ok    { color: #15803d; } .km-status-pill.ok .dot    { background: var(--green); box-shadow: 0 0 0 4px rgba(34,197,94,.16); }
.km-status-pill.warn  { color: #c2410c; } .km-status-pill.warn .dot  { background: var(--orange); box-shadow: 0 0 0 4px rgba(249,115,22,.16); }
.km-status-pill.down  { color: #b91c1c; } .km-status-pill.down .dot  { background: var(--red); box-shadow: 0 0 0 4px rgba(239,68,68,.16); }

/* ─────────────────────────────  CARDS / GRID  ───────────────────────────── */
.km-grid { display: grid; gap: 16px; }
.km-kpis { grid-template-columns: repeat(6, 1fr); margin-bottom: 16px; align-items: stretch; }
/* Todas las tarjetas KPI de una fila con la MISMA altura (aunque una etiqueta ocupe 2 líneas). */
.km-kpis > .km-kpi { align-self: stretch; min-height: 108px; }
.km-cols-2 { grid-template-columns: 1.6fr 1fr; margin-bottom: 16px; }
.km-cols-2b { grid-template-columns: 1fr 1fr; margin-bottom: 16px; }
.km-cols-3 { grid-template-columns: 1fr 1fr 1fr; margin-bottom: 16px; }
@media (max-width: 900px) { .km-cols-3 { grid-template-columns: 1fr; } }
/* Actividad diaria (izq) compartiendo fila con los donuts apilados (dcha), alineados arriba para que el
   gráfico quede compacto (no estirado a la altura del stack). */
.km-chart-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: stretch; margin-bottom: 16px; }
.km-donut-stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.km-donut-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-width: 0; }
.km-donut-pair > .km-card { min-width: 0; }
/* El gráfico de Actividad llena la altura del bloque de donuts (el SVG usa preserveAspectRatio=none). */
.km-chart-row > .km-card:first-child { display: flex; flex-direction: column; }
.km-chart-row .km-chart-wrap { flex: 1; min-height: 0; display: flex; }
.km-chart-row .km-chart-wrap .km-chart { flex: 1; min-height: 0; display: flex; }
.km-chart-row .km-chart-wrap .km-chart-svg { flex: 1; min-height: 0; }
.km-chart-row .km-chart-wrap svg { width: 100%; height: 100%; display: block; }
@media (max-width: 900px) {
  .km-chart-row { grid-template-columns: 1fr; align-items: start; }
  .km-chart-row .km-chart-wrap svg { height: auto; }   /* en móvil, altura natural del gráfico */
  .km-donut-pair { grid-template-columns: 1fr; }
}

.km-card {
  background: var(--card); border: none; border-radius: var(--radius);
  padding: 24px; box-shadow: none; margin-bottom: 18px;
}
.km-card:last-child { margin-bottom: 0; }
/* Igualar la altura de tarjetas EN FILA: dentro de un grid la separación la da `gap`, pero el
   margin-bottom (18px) de .km-card, junto con su reset a 0 en :last-child, hacía que la ÚLTIMA
   tarjeta (la de más a la derecha) se estirara 18px MÁS que las demás con align-items:stretch. Se
   anula el margin para las tarjetas hijas de estos grids → todas quedan igual de altas. */
.km-grid > .km-card,
.km-ia-wrap > .km-card,
.km-donut-pair > .km-card,
.km-camp-cols > .km-card { margin-bottom: 0; }

.km-card-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.km-card-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; }
.km-card-title.lg { font-size: 15px; text-transform: none; letter-spacing: -.2px; color: var(--ink); }

/* KPI card */
.km-kpi { display: flex; flex-direction: column; gap: 8px; min-height: 118px; }
.km-kpi-top { display: flex; align-items: center; justify-content: space-between; }
.km-kpi-label { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.km-kpi-ico {
  width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: var(--line-soft); color: var(--ink-soft);
}
.km-kpi-ico svg { width: 17px; height: 17px; }
.km-kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.8px; line-height: 1.1; }
.km-kpi-foot { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.km-delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; }
.km-delta.up   { color: #16a34a; }
.km-delta.down { color: #dc2626; }
.km-kpi-note { color: var(--muted); font-size: 11.5px; }

/* Chart card */
.km-chart-wrap { width: 100%; }
.km-chart-wrap svg { width: 100%; height: auto; display: block; }
.km-legend { display: flex; gap: 16px; }
.km-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.km-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Donut */
.km-donut-wrap { display: flex; align-items: center; gap: 18px; }
.km-donut-center text { font-family: var(--font); }
.km-donut-legend { display: flex; flex-direction: column; gap: 9px; flex: 1; }
.km-donut-legend .row { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.km-donut-legend .row i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.km-donut-legend .row b { margin-left: auto; font-weight: 700; }
.km-donut-legend .row span { color: var(--ink-soft); }

/* Channels card (iOS icons) */
.km-channel {
  display: flex; align-items: center; gap: 14px; padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}
.km-channel:last-child { border-bottom: none; padding-bottom: 2px; }
.km-channel-ico { flex: none; }
.km-channel-body { flex: 1; min-width: 0; }
.km-channel-name { font-size: 14.5px; font-weight: 600; }
.km-channel-desc { font-size: 12.5px; color: var(--muted); }
.km-channel-stat { text-align: right; }
.km-channel-stat b { font-size: 17px; font-weight: 700; letter-spacing: -.4px; }
.km-channel-stat span { display: block; font-size: 11px; color: var(--muted); }

/* Health bar */
.km-health-bar {
  height: 12px; border-radius: 8px; overflow: hidden; display: flex; margin: 4px 0 14px;
}
.km-health-bar i { height: 100%; }
.km-health-legend { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.km-health-legend .h { font-size: 12.5px; }
.km-health-legend .h .k { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.km-health-legend .h .k i { width: 8px; height: 8px; border-radius: 50%; }
.km-health-legend .h .v { font-size: 19px; font-weight: 700; letter-spacing: -.3px; margin-top: 2px; }

/* Heatmap (con eje de horas arriba + tooltip al pasar el cursor) */
.km-heat { display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto 1fr; column-gap: 8px; row-gap: 6px; }
.km-heat-corner { grid-column: 1; grid-row: 1; }
.km-heat-axis { grid-column: 2; grid-row: 1; display: grid; gap: 4px; }
.km-heat-axis span { font-size: 10px; color: var(--muted); text-align: center; line-height: 1; font-weight: 600; }
.km-heat-side { grid-column: 1; grid-row: 2; display: grid; grid-template-rows: repeat(7, 1fr); gap: 4px; }
.km-heat-rowlabel { font-size: 11px; color: var(--muted); display: flex; align-items: center; }
.km-heat-grid { grid-column: 2; grid-row: 2; display: grid; grid-auto-rows: 18px; gap: 4px; }
.km-heat-cell { border-radius: 4px; background: #eef2f6; transition: outline .08s; }
.km-heat-cell:hover { outline: 2px solid rgba(15,17,21,.55); outline-offset: -1px; cursor: default; }

/* Mini bot-status card (resumen) */
.kortmindmini { display: flex; align-items: center; gap: 14px; }
.kortmindmini-ring {
  width: 46px; height: 46px; border-radius: 13px; flex: none;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.kortmindmini.ok   .kortmindmini-ring { background: linear-gradient(135deg,#34d399,#059669); }
.kortmindmini.warn .kortmindmini-ring { background: linear-gradient(135deg,#fb923c,#ea580c); }
.kortmindmini.down .kortmindmini-ring { background: linear-gradient(135deg,#f87171,#dc2626); }
.kortmindmini-ring svg { width: 24px; height: 24px; }
.kortmindmini-label { font-size: 15px; font-weight: 700; }
.kortmindmini-sub   { font-size: 12.5px; color: var(--muted); }
.kortmindmini-cta { margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--acento-osc); }

/* ─────────────────────────────  CRM TABLE  ───────────────────────────── */
.km-table { width: 100%; border-collapse: collapse; }
.km-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); font-weight: 700; padding: 0 12px 12px; border-bottom: none;
}
.km-table td { padding: 12px; border-bottom: none; font-size: 14px; vertical-align: middle; }
.km-table tbody tr { border-radius: 12px; }
.km-table tbody tr:hover td { background: #f5f7f9; }
.km-table tbody tr:hover td:first-child { border-radius: 12px 0 0 12px; }
.km-table tbody tr:hover td:last-child { border-radius: 0 12px 12px 0; }
.km-person { display: flex; align-items: center; gap: 11px; }
.km-person-av {
  width: 36px; height: 36px; border-radius: 11px; flex: none; color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.km-person b { font-weight: 600; }
.km-person small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.km-chips { display: flex; gap: 7px; }
.km-tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: var(--pill);
  font-size: 12px; font-weight: 600;
}
.km-tag.activo    { background: var(--green-soft); color: #15803d; }
.km-tag.riesgo    { background: #fef3c7; color: #b45309; }
.km-tag.perdido   { background: #fee2e2; color: #b91c1c; }
.km-tag.nuevo     { background: var(--blue-soft); color: #1d4ed8; }
.km-ch-icons { display: flex; gap: 8px; }
.km-ch-icons .off { opacity: .28; filter: grayscale(1); }

/* Campaign cards */
.km-camp {
  display: flex; align-items: center; gap: 16px; padding: 16px;
  border: none; border-radius: var(--radius-sm); margin-bottom: 12px; background: var(--fill);
}
.km-camp:last-child { margin-bottom: 0; }
.km-camp-body { flex: 1; min-width: 0; }
.km-camp-title { font-size: 15px; font-weight: 600; }
.km-camp-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.km-camp-state {
  font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 20px;
}
.km-camp-state.sent  { background: var(--green-soft); color: #15803d; }
.km-camp-state.draft { background: #eef2f6; color: #4b5563; }
.km-camp-state.sched { background: var(--blue-soft); color: #1d4ed8; }
.km-camp-metrics { display: flex; gap: 22px; }
.km-camp-metrics div { text-align: center; }
.km-camp-metrics b { font-size: 17px; font-weight: 700; display: block; letter-spacing: -.3px; }
.km-camp-metrics span { font-size: 11px; color: var(--muted); }
.km-camp.is-click { cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .12s; }
.km-camp.is-click:hover { border-color: var(--acento); box-shadow: 0 4px 14px rgba(15,17,21,.06); }
.km-camp-chev { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }

/* KPI sub-line (dashboard de campañas) */
.km-kpi-sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.3; }
.km-camp-actionbar { display: flex; justify-content: flex-end; margin-bottom: 14px; }

/* Fila ranking + donut */
.km-camp-cols { display: grid; grid-template-columns: 1.8fr 1fr; gap: 18px; margin-bottom: 18px; align-items: start; }
@media (max-width: 900px) { .km-camp-cols { grid-template-columns: 1fr; } }

/* Ranking de mejores campañas */
.km-crank { display: flex; flex-direction: column; }
.km-crank-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 8px;
  border-bottom: 1px solid var(--line); border-radius: 8px;
}
.km-crank-row:last-child { border-bottom: 0; }
.km-crank-row.is-click { cursor: pointer; transition: background .12s; }
.km-crank-row.is-click:hover { background: #f7f9fb; }
.km-crank-ch { display: flex; flex-shrink: 0; }
.km-crank-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.km-crank-m { text-align: center; min-width: 62px; }
.km-crank-m b { display: block; font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.km-crank-m i { font-size: 10.5px; color: var(--muted); font-style: normal; }
@media (max-width: 560px) { .km-crank-m:first-of-type { display: none; } }

/* Detalle de campaña (modal) */
.km-cdet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.km-cdet-ch { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.km-cdet-when { font-size: 12.5px; color: var(--muted); }
.km-cdet-rows { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.km-cdet-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.km-cdet-row:last-child { border-bottom: 0; }
.km-cdet-row .k { color: var(--muted); font-size: 13.5px; }
.km-cdet-row .v b { font-size: 16px; font-weight: 700; }
.km-cdet-row .v i { color: var(--muted); font-style: normal; font-size: 12.5px; font-weight: 600; }
.km-cdet-funnel { margin-top: 16px; }
.km-cdet-funnel h4 { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: #334155; }
.km-funnel-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.km-funnel-l { width: 88px; flex-shrink: 0; font-size: 12.5px; color: #475569; }
.km-funnel-track { flex: 1; height: 12px; background: #eef2f6; border-radius: 7px; overflow: hidden; }
.km-funnel-track i { display: block; height: 100%; border-radius: 7px; transition: width .3s; }
.km-funnel-v { width: 56px; text-align: right; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.km-cdet-note { margin-top: 14px; padding: 12px 14px; background: #f7f9fb; border-radius: 10px; font-size: 12.5px; color: var(--muted); }

/* Estado (real) view */
.km-estado-wrap { max-width: 460px; margin: 0 auto; }
.km-estado-card {
  background: #fff; border: none; border-radius: var(--radius);
  padding: 30px; text-align: center; box-shadow: var(--shadow); margin-bottom: 18px;
}
.km-estado-badge {
  width: 76px; height: 76px; border-radius: 22px; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.km-estado-badge svg { width: 40px; height: 40px; }
.km-estado-card.ok   .km-estado-badge { background: linear-gradient(135deg,#34d399,#059669); }
.km-estado-card.warn .km-estado-badge { background: linear-gradient(135deg,#fb923c,#ea580c); }
.km-estado-card.down .km-estado-badge { background: linear-gradient(135deg,#f87171,#dc2626); }
.km-estado-title { font-size: 22px; font-weight: 700; letter-spacing: -.4px; }
.km-estado-msg { color: var(--muted); font-size: 14px; margin-top: 6px; }
.km-estado-rows { margin-top: 22px; text-align: left; }
.km-estado-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; background: #f7f9fb; border-radius: 11px; margin-bottom: 8px; font-size: 13.5px;
}
.km-estado-row .k { color: var(--muted); }
.km-estado-row .v { font-weight: 600; }

.km-qr-card { background: #fff; border: none; border-radius: var(--radius); padding: 26px; text-align: center; box-shadow: none; }
.km-qr-title { font-size: 15px; font-weight: 700; margin-bottom: 18px; }
.km-qr-image { background: #fff; padding: 14px; border-radius: var(--radius-sm); display: inline-block; border: none; }
.km-qr-image img { width: 210px; height: 210px; display: block; }
.km-qr-countdown { font-size: 13px; color: var(--muted); margin: 16px 0 6px; }
.km-qr-countdown span { color: var(--acento-osc); font-weight: 700; }
.km-qr-help { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.km-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; background: var(--acento); color: #fff; border: none; border-radius: var(--pill);
  font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit; margin-top: 18px;
  transition: transform .15s, box-shadow .2s;
}
.km-btn:hover:not(:disabled) { background: var(--acento-osc); }
.km-btn:disabled { opacity: .6; cursor: not-allowed; }

.km-spinner {
  display: inline-block; width: 22px; height: 22px; border: 3px solid var(--line);
  border-top-color: var(--acento-osc); border-radius: 50%; animation: spin .8s linear infinite;
  margin-right: 10px; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
.km-loading { display: flex; align-items: center; justify-content: center; padding: 34px 20px; color: var(--muted); font-size: 14px; }

.km-empty { text-align: center; color: var(--muted); padding: 40px 20px; font-size: 14px; }

/* ─────────────────────────────  RESPONSIVE  ───────────────────────────── */
@media (max-width: 1100px) {
  .km-kpis { grid-template-columns: repeat(3, 1fr); }
  .km-cols-2, .km-cols-2b { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  /* En móvil la barra lateral es un CAJÓN (drawer) que se abre con la hamburguesa. */
  /* CLAVE (móvil "a media pantalla"): forzamos SIEMPRE 1 sola columna con !important y SIN transición.
     Motivos: (a) iOS Safari deja el :hover PEGADO tras tocar y `.km-app:has(.km-sidebar:hover)` (más
     específico que `.km-app`, y :has ignora la media query) metía el grid en `244px 1fr` → contenido a
     media pantalla; (b) la transición de `grid-template-columns` podía quedarse "a medias" al cambiar de
     vista hasta tocar/deslizar. Con !important + transition:none el contenido ocupa el ancho al instante. */
  .km-app, .km-app:has(.km-sidebar:hover) { grid-template-columns: 1fr !important; grid-template-rows: auto 1fr; width: 100%; max-width: 100vw; height: 100vh; height: 100dvh; transition: none !important; }
  .km-main { min-width: 0; max-width: 100vw; width: 100%; grid-column: 1 !important; }
  .km-kpis { min-width: 0; }
  .km-mobile-top { display: flex; }
  .km-sidebar {
    width: 268px; padding: 18px 14px; z-index: 130;
    top: 0; left: 0; bottom: 0; border-radius: 0;
    transform: translateX(-100%); transition: transform .25s ease; box-shadow: none;
    flex-direction: column; overflow: hidden;
  }
  .km-sidebar:hover { width: 268px; box-shadow: none; }   /* sin hover en táctil */
  .km-app.km-drawer-open .km-sidebar { transform: translateX(0); box-shadow: 0 0 44px rgba(0,0,0,.5); }
  /* etiquetas siempre visibles dentro del cajón */
  .km-brand-name, .km-brand-sub, .km-nav-item span,
  .km-club-name, .km-club-role, .km-logout-link span, #km-club-menu,
  .km-lang-link span, #km-lang-menu { opacity: 1 !important; }
  .km-nav { flex-direction: column; }
  .km-nav-item { flex-direction: row; gap: 12px; padding: 11px 12px; font-size: 14.5px; white-space: nowrap; }
  .km-nav-badge { display: inline-block; }
  /* En el cajón del móvil no hay `:hover` pero las etiquetas SÍ se ven, así que el chip tiene que
     llevar su tarjeta igual: con el nombre al lado y sin fondo, las dos cosas flotan sueltas. */
  .km-club-chip { justify-content: flex-start; gap: 10px; padding: 6px 12px; }
  /* En el cajón no hay nada plegado: el idioma y el salir se ven siempre. */
  .km-lang-link, .km-logout-link { display: flex; justify-content: flex-start; gap: 9px; padding: 9px 12px; }
  /* En el cajón no hay nada plegado, así que el bloque del nombre vuelve a crecer y la flecha del
     idioma vuelve a verse: aquí sí hay sitio y sí hacen falta. */
  .km-club-txt { flex: 1; }
  .km-lang-caret { display: inline; }
  /* El gris de borde a borde es cosa del rail estrecho: dentro del cajón ancho sería una banda
     enorme, así que aquí el pie vuelve a ser una zona sin fondo. */
  .km-side-foot { margin: auto 0 0; padding: 10px 0 0; background: none; }
  /* Sin `:hover` en táctil, así que aquí las etiquetas recuperan su ancho de oficio. */
  .km-club-name, .km-club-role, .km-logout-link span, #km-club-menu,
  .km-lang-link span, #km-lang-menu, .km-brand-name, .km-brand-sub,
  .km-nav-item span { max-width: none; }
  .km-app.km-drawer-open .km-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 120; }
  .km-main { grid-column: 1; grid-row: 2; padding: 16px 16px 50px; }
}
@media (max-width: 620px) {
  .km-kpis { grid-template-columns: repeat(2, 1fr); }
  .km-topbar h1 { font-size: 20px; }
  .km-camp { flex-wrap: wrap; }
}

/* ============================================================================
   BLINDAJE contra el tema de WordPress
   Algunos temas estilizan globalmente <button>/<a> (p. ej. fondo de su acento + texto
   blanco), lo que dejaba los botones del panel ILEGIBLES. Aquí forzamos los
   colores propios con selectores de clase + !important (ganan a las reglas de
   elemento del tema, aunque el tema use !important).
   ========================================================================== */
.km-app button,
.km-login-screen button,
.km-app a,
.km-login-screen a {
  background-image: none !important;
  text-shadow: none !important;
  text-decoration: none !important;
  min-height: 0 !important;
  line-height: 1.4;
}

/* Navegación lateral */
.km-nav-item { background: transparent !important; color: var(--side-muted) !important; text-transform: none !important; letter-spacing: normal !important; box-shadow: none !important; }
.km-nav-item svg { stroke: currentColor !important; }
/* Iconos de marca (logo relleno, p. ej. WhatsApp): se pintan con fill, sin trazo */
.km-nav-item svg.km-navlogo { stroke: none !important; fill: currentColor !important; }
.km-nav-item svg.km-navlogo path { stroke: none !important; fill: currentColor !important; }
.km-nav-item.active svg.km-navlogo, .km-nav-item.active svg.km-navlogo path { fill: #fff !important; stroke: none !important; }
/* Noa: glifo relleno dibujado con una MÁSCARA, no con fill-rule. Necesita reglas propias y NO
   sirve `km-navlogo`, porque esa fuerza `fill: currentColor !important` en TODOS los `path`, y
   los de dentro de una máscara no son color sino LUMINANCIA (#fff se ve, #000 se recorta). Si se
   les pinta currentColor, los huecos —ojo, anillos, ranuras de las patas— dejan de recortar y el
   perro se queda macizo. Aquí solo se tocan el `svg` y el `rect` que lleva la máscara; los `path`
   de dentro se dejan en paz A PROPÓSITO.
   El fill explícito del estado activo hace falta porque `.km-nav-item` fija `color` con
   !important, así que `currentColor` no cambia al activarse (mismo motivo que en km-navlogo). */
.km-nav-item svg.km-navbot { stroke: none !important; fill: currentColor !important; }
.km-nav-item svg.km-navbot > rect { stroke: none !important; fill: currentColor !important; }
.km-nav-item.active svg.km-navbot,
.km-nav-item.active svg.km-navbot > rect { fill: #fff !important; stroke: none !important; }
/* Plantillas rápidas del chat de Playtomic — blancas, no del acento del tema (blindaje) */
.pt-tpl { background: #f7f9fb !important; color: #4b5563 !important; text-transform: none !important; letter-spacing: normal !important; box-shadow: none !important; }
.pt-tpl:hover { background: #eef2f6 !important; color: #4b5563 !important; }
.km-nav-item:hover { background: var(--sidebar-2) !important; color: var(--ink) !important; }
.km-nav-item.active { background: var(--acento) !important; color: #fff !important; }
.km-nav-item.active svg { stroke: #fff !important; }
.km-nav-badge { background: var(--fill) !important; color: var(--side-muted) !important; }
.km-nav-item.active .km-nav-badge { background: rgba(255,255,255,.22) !important; color: #fff !important; }

/* Cerrar sesión */
.km-logout-link, .km-lang-link { background: transparent !important; color: var(--side-muted) !important; text-transform: none !important; box-shadow: none !important; }
/* ⚠️ Estas dos líneas llevan el hover CON `!important` a propósito, y no es por capricho: la línea
   de arriba fija `background: transparent !important` para ganarle al tema de WordPress, y eso le
   ganaba también al hover propio — el resultado era un menú donde al pasar el cursor no pasaba
   nada y no se sabía qué ibas a pulsar. Si se quita el !important de aquí, vuelve a desaparecer. */
.km-lang-item, .km-club-menu-item { background: transparent !important; text-transform: none !important; box-shadow: none !important; }
.km-lang-item:hover, .km-club-menu-item:hover { background: rgba(0,0,0,.06) !important; }
.km-lang-item.on, .km-club-menu-item.on { color: var(--acento) !important; }
.km-logout-link:hover { background: var(--sidebar-2) !important; color: var(--ink) !important; }

/* Botón de acento de acción (Actualizar) — texto blanco legible */
.km-btn { background: var(--acento) !important; color: #fff !important; text-transform: none !important; letter-spacing: .2px !important; }
.km-btn:hover:not(:disabled) { background: #C2004D !important; color: #fff !important; }
/* Botón "Entrar" del login: magenta de marca, no el acento del tema.
   El blindaje tiene que repetir el tamaño de letra: sin él, un tema que fije `font-size` en
   `button` dejaría el botón en 16px y el blanco sobre magenta (3,9:1) ya no cumpliría — ver la
   regla de arriba. */
/* ⚠️ El ANCHO también hay que blindarlo, y esta es la razón: en la captura del móvil el botón
   salía pequeño y pegado a la izquierda en vez de ir de lado a lado. `.km-login-btn{width:100%}`
   es una clase (0,1,0) y el tema de WordPress estila sus botones con algo más específico, así que
   le ganaba. Sin esto, «Entrar» se ve como un botón cualquiera del tema —y descolocado— en lugar
   del botón principal de la pantalla. `display:block` por lo mismo: un `inline-block` del tema
   deja el ancho a merced de lo que mida el texto.
   Y el RADIO por el mismo motivo: 12px es el valor de marca y está puesto en la regla normal,
   pero esa regla es una clase y el tema puede ganarle igual que le ganaba al ancho. Reportado:
   «no son iguales» comparando el panel con el candado del bot, teniendo los dos un 12 escrito.
   Con esto deja de depender de con qué tema se publique la página. */
.km-login-btn { background: #FF0066 !important; color: #fff !important; text-transform: none !important; letter-spacing: .2px !important; font-size: 19px !important; font-weight: 700 !important; width: 100% !important; display: block !important; border-radius: 12px !important; }
.km-login-btn:hover:not(:disabled) { background: #C2004D !important; color: #fff !important; }
/* El texto de ayuda y los fondos: algunos temas pintan `p` y `div` con su propio color.
   ⚠️ Desde que la entrada está partida en dos, el fondo negro es el de la MITAD izquierda, no el
   de la pantalla entera: la pantalla es blanca y el formulario vive sobre ella. */
.km-login-ayuda { color: #4D4D4D !important; }
.km-login-screen { background: #FFFFFF !important; }
.km-login-marca { background: #0A0A0A !important; }
.km-rec-fondo { background: rgba(10,10,10,.55) !important; }
.km-rec-caja { background: #FFFFFF !important; }

/* Selector de periodo (7 días / 30 días / 3 meses) */
.km-segment button { background: transparent !important; color: var(--muted) !important; text-transform: none !important; letter-spacing: normal !important; box-shadow: none !important; }
.km-segment button.active { background: #fff !important; color: var(--ink) !important; }

/* Pestañas de integraciones (blindaje contra estilos globales de <button> del tema) */
.km-int-tabs button { background: transparent !important; color: #6b7280 !important; text-transform: none !important; letter-spacing: normal !important; box-shadow: none !important; }
.km-int-tabs button.active { background: #fff !important; color: var(--ink) !important; box-shadow: var(--shadow-sm) !important; }

/* Chips-resumen de la Recepción IA (Notificar/Pausa/Horario…) — blancos, no del acento del tema */
.km-sched-summary { background: #fff !important; color: #16180f !important; text-transform: none !important; letter-spacing: normal !important; box-shadow: none !important; }
.km-sched-summary:hover:not(:disabled) { background: #f5f7f9 !important; border-color: #16180f !important; }
.km-sched-summary:disabled { background: #f4f5f7 !important; color: #b0b6bd !important; border-color: #e6e8eb !important; }

/* Filtros de Chats Playtomic (Sin leer / Preguntas / Sugeridos / Todos) — mismo estilo que las pestañas */
.pt-filters button { background: transparent !important; color: #6b7280 !important; text-transform: none !important; letter-spacing: normal !important; box-shadow: none !important; }
.pt-filters button.active { background: #fff !important; color: var(--ink) !important; box-shadow: var(--shadow-sm) !important; }

/* Píldora de estado del bot en la topbar */
.km-status-pill { background: #fff !important; }

/* Chips de segmento y botones pequeños de Clientes (buscador/exportar) —
   el tema los pintaba con su acento, ilegibles; forzamos fondo blanco + texto oscuro. */
.km-segchip { background: var(--fill) !important; border: none !important; color: var(--ink-soft) !important; text-transform: none !important; letter-spacing: normal !important; }
.km-segchip:hover { background: var(--fill-hover) !important; color: var(--ink-soft) !important; }
.km-segchip.active { background: var(--ink) !important; color: #fff !important; }
.km-segchip b { color: inherit !important; }
.km-btn-sm { background: var(--fill) !important; border: none !important; color: var(--ink-soft) !important; text-transform: none !important; letter-spacing: normal !important; }
.km-btn-sm:hover { background: var(--fill-hover) !important; color: var(--ink-soft) !important; }
.km-input, .km-sel { background: var(--fill) !important; border: none !important; color: var(--ink) !important; text-transform: none !important; }

/* ============================================================================
   Tooltips de gráficos (actividad / donut / heatmap) + ficha de jugador
   ========================================================================== */
.km-chart, .km-donut-svg, .km-heat-wrap { position: relative; }
.km-chart-svg { position: relative; }
.km-chart { cursor: crosshair; }
.km-chart-cols { position: absolute; inset: 0; display: flex; pointer-events: none; }
.km-chart-col { flex: 1; }
.km-chart-col:hover { background: rgba(255,0,102,.06); }
.km-donut-svg { display: inline-block; }
.km-donut-arc { cursor: pointer; }

.km-chart-tip, .km-heat-tip, .km-donut-tip {
  position: absolute; transform: translate(-50%, 0);
  background: #0f1115; color: #fff; font-size: 12px; font-weight: 600;
  padding: 7px 10px; border-radius: 9px; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .1s; z-index: 30; box-shadow: 0 8px 20px rgba(0,0,0,.28);
  line-height: 1.4;
}
.km-chart-tip.show, .km-heat-tip.show, .km-donut-tip.show { opacity: 1; }
.km-chart-tip b, .km-heat-tip b, .km-donut-tip b { color: #FF0066; }

/* Fila de jugador clicable */
.km-row { cursor: pointer; }

/* Modal — ficha del jugador */
.km-modal-overlay {
  position: fixed; inset: 0; z-index: 100000; background: rgba(15,17,21,.55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.km-modal {
  background: #fff; border-radius: 20px; width: 100%; max-width: 640px; max-height: 90vh;
  overflow-y: auto; padding: 26px; position: relative; box-shadow: 0 30px 80px rgba(0,0,0,.4);
}
.km-modal-close {
  position: absolute; top: 16px; right: 16px; border: none !important;
  background: #f1f3f6 !important; color: #6b7280 !important;
  width: 36px !important; height: 36px !important; min-height: 0 !important; padding: 0 !important;
  border-radius: 50% !important; font-size: 20px !important; line-height: 1 !important;
  cursor: pointer; font-family: inherit; display: flex !important;
  align-items: center; justify-content: center; box-shadow: none !important;
}
.km-modal-close:hover { background: #e5e8ec !important; color: #111 !important; }
.km-modal-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; padding-right: 40px; }
.km-modal-av { width: 64px; height: 64px; border-radius: 18px; color: #fff; font-weight: 700; font-size: 22px; display: flex; align-items: center; justify-content: center; flex: none; }
.km-modal-id { flex: 1; min-width: 0; }
.km-modal-name { font-size: 21px; font-weight: 700; letter-spacing: -.3px; }
.km-modal-tags { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.km-modal-ch { display: flex; gap: 8px; }
.km-modal-ch .off { opacity: .28; filter: grayscale(1); }
.km-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.km-modal-block { background: #f7f9fb; border-radius: 14px; padding: 16px; }
.km-modal-block h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 10px; }
.km-modal-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; font-size: 13.5px; }
.km-modal-row span { color: var(--muted); }
.km-modal-row b { font-weight: 600; text-align: right; word-break: break-word; }
/* Paginación de clientes — a prueba del tema de WordPress */
.km-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* Ingresos por concepto (ficha del jugador): fila con barra de proporción. */
.km-inc-row { padding: 8px 0; border-bottom: 1px solid #eef2f7; }
.km-inc-row:last-child { border-bottom: 0; }
.km-inc-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13.5px; margin-bottom: 6px; }
.km-inc-top span { color: #334155; }
.km-inc-top b { font-weight: 700; }
.km-inc-bar { height: 6px; background: #eef2f7; border-radius: 4px; overflow: hidden; }
.km-inc-bar i { display: block; height: 100%; background: #16a34a; border-radius: 4px; }
.km-pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin-top: 16px; }
.km-pg {
  min-width: 38px !important; height: 38px !important; padding: 0 10px !important;
  border: 1px solid #e2e8f0 !important; background: #fff !important; box-shadow: none !important;
  border-radius: 10px !important; font-weight: 600 !important; font-size: 13.5px !important;
  line-height: 1 !important; color: #334155 !important; cursor: pointer !important;
  display: inline-flex !important; align-items: center; justify-content: center;
  text-transform: none !important; letter-spacing: 0 !important; transition: all .15s ease;
}
.km-pg:hover:not(.disabled):not(.active) { background: #f1f5f9 !important; border-color: #cbd5e1 !important; }
.km-pg.active { background: #12141a !important; border-color: #12141a !important; color: #fff !important; }
.km-pg.disabled, .km-pg:disabled { opacity: .4 !important; cursor: default !important; }
.km-pg-gap { padding: 0 2px; color: #94a3b8; align-self: center; }
.km-mate-click { cursor: pointer; }
.km-mate-click:hover .km-mate-av { outline: 2px solid #FF0066; outline-offset: 1px; }
/* Tabla de "juega con" (Amigos ampliado) */
.km-mates-table td, .km-mates-table th { font-size: 13px; }
tr.km-mate-row.km-mate-click { cursor: pointer; }
tr.km-mate-row.km-mate-click:hover td { background: #f7f9fb; }
.km-mates-table .km-person-av { width: 30px; height: 30px; font-size: 12px; }

/* Móvil: KPIs de clientes (4 columnas) a 2, y tabla con scroll horizontal */
@media (max-width: 640px) {
  .km-kpis[style*="repeat(4"] { grid-template-columns: repeat(2, 1fr) !important; }
  .km-table th, .km-table td { white-space: nowrap; }
  .km-table td .km-person small { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
}
/* KPIs de Grupos (5 columnas inline): el inline gana a las media queries de .km-kpis, así que aquí
   forzamos el responsive con !important para que no se corten por la derecha en tablet/móvil. */
@media (max-width: 1100px) { .km-kpis[style*="repeat(5"] { grid-template-columns: repeat(3, 1fr) !important; } }
@media (max-width: 640px)  { .km-kpis[style*="repeat(5"] { grid-template-columns: repeat(2, 1fr) !important; } }

/* Ayuda "?" (tooltip nativo con la definición de cada grado) */
.km-help {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; border-radius: 50%; background: #e2e8f0; color: #475569;
  font-size: 11px; font-weight: 700; cursor: help; vertical-align: middle; margin-left: 4px;
}
.km-help:hover { background: #cbd5e1; color: #1e293b; }

/* Salud de los grupos (Estado del bot) */
.km-grp-list { display: flex; flex-direction: column; gap: 8px; }
.km-grp-row { display: grid; grid-template-columns: 1fr auto auto auto auto; align-items: center; gap: 12px; padding: 10px 12px; background: #f7f9fb; border-radius: 10px; }
.km-grp-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.km-grp-mem { font-weight: 700; font-size: 15px; white-space: nowrap; }
.km-grp-mem span { font-weight: 400; font-size: 11.5px; color: var(--muted); margin-left: 4px; }
.km-grp-tr { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.km-grp-rk .km-tag { font-size: 11.5px; }
@media (max-width: 640px) {
  .km-grp-row { grid-template-columns: 1fr auto; row-gap: 6px; }
  .km-grp-name { grid-column: 1 / -1; }
}
.km-modal-lg { max-width: 720px; }
/* Foto del jugador (Playtomic) sobre las iniciales de fondo */
.km-modal-av { position: relative; overflow: hidden; }
.km-av-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.km-av-ini { position: relative; z-index: 0; }
/* Pestañas de la ficha del jugador — control segmentado (estilo iOS), a prueba del tema de WordPress */
.km-ptabs {
  display: flex !important; gap: 3px; background: #eef2f7; border: none !important;
  border-radius: 12px; padding: 4px; margin: 6px 0 18px; max-width: 100%; box-sizing: border-box;
  flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.km-ptabs::-webkit-scrollbar { display: none; }
.km-ptab { flex: none; }
.km-ptab {
  border: none !important; background: transparent !important; box-shadow: none !important; outline: none !important;
  padding: 8px 18px !important; font-size: 13.5px !important; font-weight: 600 !important; line-height: 1.2 !important;
  color: #64748b !important; cursor: pointer !important; border-radius: 9px !important; min-height: 0 !important;
  height: auto !important; letter-spacing: 0 !important; text-transform: none !important; transition: all .16s ease;
}
.km-ptab:hover:not(.active) { color: #334155 !important; background: rgba(255,255,255,.5) !important; }
.km-ptab.active {
  background: #fff !important; color: #12141a !important; box-shadow: 0 1px 3px rgba(15,23,42,.14) !important;
}
@media (max-width: 480px) { .km-ptab { padding: 8px 14px !important; } }
.km-wk-wrap { position: relative; background: #f7f9fb; border-radius: 12px; padding: 10px 12px 4px; }
.km-wk-wrap svg { display: block; height: 170px; }
.km-wk-dot { cursor: pointer; }
.km-wk-dot:hover { fill: rgba(22,163,74,.18); }
.km-mates { display: flex; flex-wrap: wrap; gap: 14px; }
.km-mate { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 56px; }
.km-mate-av { width: 44px; height: 44px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.km-mate span { font-size: 11.5px; color: var(--ink-soft); max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .km-modal-grid { grid-template-columns: 1fr; } }

/* Ocultar columnas secundarias en pantallas pequeñas */
@media (max-width: 720px) { .km-hide-sm { display: none !important; } }

/* ── Clientes: chips de segmento, buscador, filtros, exportar ── */
.km-tag.alejandose { background: #fdf0d5; color: #9a6b00; }
.km-segchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.km-segchip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 15px; border-radius: var(--pill);
  border: none; background: var(--fill); color: var(--ink-soft); font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; box-shadow: none;
}
.km-segchip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.km-segchip b { font-weight: 800; }
.km-segchip:hover { background: var(--fill-hover); }
.km-segchip.active { background: var(--ink); color: #fff; }
.km-crm-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.km-input {
  border: none; border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; font-family: inherit;
  background: var(--fill); color: var(--ink); outline: none;
}
.km-input:focus { background: #fff; box-shadow: inset 0 0 0 2px #FF0066; }
#km-crm-search { flex: 1; min-width: 200px; }
.km-crm-searchwrap { flex: 1; min-width: 200px; display: flex; gap: 4px; align-items: center; }
/* Icono de filtros: botón plano, sin tarjeta ni borde (se blinda con !important frente al tema WP). */
.km-crm-filterbtn {
  position: relative; flex: 0 0 auto; width: 38px; height: 38px; padding: 0 !important;
  background: transparent !important; border: none !important; box-shadow: none !important;
  color: var(--ink-soft) !important; border-radius: 10px; cursor: pointer;
  display: inline-flex !important; align-items: center; justify-content: center;
  transition: color .15s ease, background .15s ease;
}
.km-crm-filterbtn svg { width: 19px; height: 19px; display: block; }
.km-crm-filterbtn:hover { background: rgba(15,23,42,.06) !important; color: var(--ink) !important; }
.km-crm-filterbtn.open { background: rgba(15,23,42,.08) !important; color: var(--ink) !important; }
.km-crm-filterbtn.has-active { color: #C2004D !important; }
.km-crm-filterbtn.has-active::after {
  content: ''; position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%;
  background: #FF0066; box-shadow: 0 0 0 2px #fff;
}
.km-crm-filters { display: flex; gap: 10px; flex-wrap: wrap; width: 100%; }
.km-crm-filters[hidden] { display: none; }
.km-crm-filters .km-sel { flex: 1; min-width: 150px; }
.km-sel { cursor: pointer; }
.km-btn-sm {
  border: none; background: var(--fill); color: var(--ink-soft); border-radius: var(--pill);
  padding: 9px 16px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.km-btn-sm:hover { background: var(--fill-hover); }
@media (max-width: 620px) { .km-crm-toolbar { flex-direction: column; } #km-crm-search { min-width: 0; } .km-crm-toolbar > * { width: 100%; } }

/* ── Horas por pista (Resumen) ── */
.km-court { display: grid; grid-template-columns: 140px 1fr 78px; align-items: center; gap: 12px; padding: 8px 0; }
.km-court:not(:last-child) { border-bottom: 1px solid var(--line-soft); }
.km-court-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.km-court-bar { height: 10px; background: #eef2f6; border-radius: 6px; overflow: hidden; }
.km-court-bar i { display: block; height: 100%; background: linear-gradient(90deg,#FF0066,#C2004D); border-radius: 6px; }
.km-court-val { text-align: right; font-size: 13.5px; font-weight: 700; }
.km-court-val span { display: block; font-size: 10.5px; color: var(--muted); font-weight: 400; }
@media (max-width: 620px) { .km-court { grid-template-columns: 96px 1fr 66px; } }

/* ── Rango de fechas personalizado ── */
.km-daterange {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  background: #fff; border: none; border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.km-daterange label { font-size: 13px; font-weight: 600; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 8px; }
.km-daterange input[type=date] {
  border: none; background: var(--fill); border-radius: var(--radius-sm); padding: 9px 12px; font-family: inherit;
  font-size: 13.5px; color: var(--ink); background: #fff;
}
.km-daterange input[type=date]:focus { outline: none; border-color: #FF0066; box-shadow: 0 0 0 3px rgba(255,0,102,.15); }
.km-daterange-note { margin-left: auto; font-size: 12px; color: var(--muted); }
@media (max-width: 620px) { .km-daterange-note { margin-left: 0; width: 100%; } }

/* ── Segmentos de campaña (vista Campañas) ── */
.km-seg-list { display: flex; flex-direction: column; gap: 8px; }
.km-seg-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: none; border-radius: var(--radius-sm); background: var(--fill); }
.km-seg-info { flex: 1; min-width: 0; }
.km-seg-name { font-weight: 700; font-size: 14px; color: var(--ink); }
.km-seg-crit { font-size: 12px; color: var(--muted); margin-top: 2px; }
.km-seg-count { text-align: center; min-width: 76px; }
.km-seg-count b { display: block; font-size: 18px; color: var(--ink); }
.km-seg-count span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.km-seg-actions { display: flex; gap: 6px; }
/* Botones de acción de la tarjeta (icono). !important para ganar al tema de WordPress. */
.km-seg-btn { width: 36px !important; height: 36px !important; min-height: 0 !important; display: inline-flex !important; align-items: center; justify-content: center; border: none !important; background: var(--fill) !important; border-radius: 12px !important; cursor: pointer; color: var(--ink-soft) !important; padding: 0 !important; box-shadow: none !important; transition: all .15s ease; }
.km-seg-btn svg { width: 18px; height: 18px; }
.km-seg-btn:hover { background: #f5f7f9 !important; border-color: #cdd3da !important; color: var(--ink) !important; }
.km-seg-btn.is-email:hover { color: #2f6bff !important; border-color: #cfe0ff !important; background: #f2f7ff !important; }
.km-seg-btn.is-wa:hover { color: #1fa855 !important; border-color: #c7ecd4 !important; background: #f2fbf5 !important; }
.km-seg-btn.is-danger:hover { color: #dc2626 !important; border-color: #fbcaca !important; background: #fff5f5 !important; }

/* Botones base del panel (primario oscuro / fantasma / peligro) — estilo limpio y moderno, !important
   para ganar a los estilos globales de <button> del tema de WordPress. */
.km-btn-primary, .km-btn-ghost, .km-btn-danger {
  display: inline-flex !important; align-items: center; justify-content: center; gap: 7px;
  border-radius: 11px !important; padding: 10px 16px !important; font-size: 13.5px !important; font-weight: 700 !important;
  line-height: 1 !important; cursor: pointer; font-family: inherit; text-transform: none !important; letter-spacing: 0 !important;
  min-height: 0 !important; box-shadow: none !important; text-shadow: none !important; transition: all .15s ease;
}
.km-btn-primary { border: 1px solid #0f1115 !important; background: #0f1115 !important; color: #fff !important; }
.km-btn-primary:hover:not(:disabled) { background: #23272e !important; border-color: #23272e !important; color: #fff !important; }
.km-btn-ghost { border: none !important; background: var(--fill) !important; color: var(--ink-soft) !important; border-radius: var(--pill) !important; }
.km-btn-ghost:hover:not(:disabled) { background: #f5f7f9 !important; color: var(--ink) !important; border-color: #cdd3da !important; }
.km-btn-danger { border: 1px solid #dc2626 !important; background: #dc2626 !important; color: #fff !important; }
.km-btn-danger:hover:not(:disabled) { background: #b91c1c !important; border-color: #b91c1c !important; color: #fff !important; }
.km-btn-primary svg, .km-btn-ghost svg, .km-btn-danger svg { width: 16px; height: 16px; stroke: currentColor; }
.km-btn-icon svg { flex: none; }
@media (max-width: 620px) { .km-seg-row { flex-wrap: wrap; } .km-seg-count { min-width: 0; } }

/* Formulario de segmento (modal) */
.km-modal-body { margin-top: 4px; }
.km-modal-body .km-input { width: 100%; box-sizing: border-box; }
.km-modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.km-seg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.km-seg-lbl { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; font-weight: 600; }
.km-seg-checks { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.km-seg-chk { display: flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer; color: var(--ink); }
.km-seg-preview { margin-top: 14px; padding: 10px 12px; background: #f6f8fa; border-radius: 8px; font-size: 12.5px; color: var(--muted); }
.km-seg-preview b { color: var(--ink); }
@media (max-width: 620px) { .km-seg-grid { grid-template-columns: 1fr; } }

/* Constructor de segmentos (builder por reglas) */
.km-segb-matchrow { font-size: 13px; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.km-segb-match { width: auto !important; min-width: 120px; padding: 6px 10px; font-weight: 700; }
.km-segb-list { display: flex; flex-direction: column; gap: 8px; }
.km-segb-row { display: flex; align-items: center; gap: 8px; }
.km-segb-row .km-input { width: auto !important; flex: 1 1 0; min-width: 0; padding: 8px 10px; }
.km-segb-row .km-segb-f { flex: 1.4 1 0; }
.km-segb-row .km-segb-op { flex: 1.1 1 0; }
.km-segb-eq { flex: 0 0 auto; font-size: 12.5px; color: var(--muted); font-weight: 700; padding: 0 4px; }
.km-segb-between { display: flex; align-items: center; gap: 6px; flex: 1.3 1 0; min-width: 0; }
.km-segb-between .km-input { flex: 1 1 0; }
.km-segb-between span { font-size: 12px; color: var(--muted); }
.km-segb-del { flex: 0 0 auto; width: 36px !important; height: 36px !important; min-height: 0 !important; display: inline-flex !important; align-items: center; justify-content: center; border: none !important; background: var(--fill) !important; border-radius: 12px !important; cursor: pointer; color: var(--ink-soft) !important; padding: 0 !important; box-shadow: none !important; transition: all .15s ease; }
.km-segb-del svg { width: 16px; height: 16px; }
.km-segb-del:hover { color: #dc2626 !important; border-color: #fbcaca !important; background: #fff5f5 !important; }
.km-segb-add { margin-top: 10px; }
.km-segb-add svg { width: 15px; height: 15px; }
.km-segb-exhead { margin: 18px 0 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.km-segb-empty { font-size: 12px; color: var(--muted); padding: 8px 2px; }
@media (max-width: 560px) { .km-segb-row { flex-wrap: wrap; } .km-segb-row .km-segb-f, .km-segb-row .km-segb-op { flex: 1 1 100%; } }

/* Jugadores añadidos a mano al segmento */
.km-seg-manual { position: relative; }
.km-seg-mresults {
  border: none; border-radius: var(--radius-sm); margin-top: 6px; overflow: hidden;
  max-height: 240px; overflow-y: auto; background: #fff;
}
.km-seg-mresults[hidden] { display: none; }
.km-seg-mopt {
  display: flex !important; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%;
  text-align: left !important; padding: 8px 12px !important; background: #fff !important; border: none !important;
  border-bottom: 1px solid #f0f2f5 !important; cursor: pointer; color: var(--ink) !important; font-family: inherit;
}
.km-seg-mopt:last-child { border-bottom: none !important; }
.km-seg-mopt:hover { background: #f6f8fa !important; }
.km-seg-mopt b { font-size: 13px; font-weight: 600; }
.km-seg-mopt small { font-size: 11.5px; color: var(--muted); }
.km-seg-mnone { padding: 10px 12px; font-size: 12px; color: var(--muted); }
.km-seg-mchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.km-seg-mempty { font-size: 12px; color: var(--muted); }
.km-seg-mchip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 11px; border-radius: 999px;
  background: #eef2f7; color: var(--ink); font-size: 12.5px; font-weight: 600;
}
.km-seg-mx {
  display: inline-flex !important; align-items: center; justify-content: center; width: 18px; height: 18px;
  border: none !important; background: rgba(15,23,42,.1) !important; color: var(--ink-soft) !important;
  border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 !important;
}
.km-seg-mx:hover { background: #ef4444 !important; color: #fff !important; }

/* Alertas (catálogo de automatizaciones) */
.km-alert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1100px) { .km-alert-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .km-alert-grid { grid-template-columns: 1fr; } }
.km-alert-card { background: #fff; border: none; border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; min-height: 128px; transition: border-color .12s, box-shadow .12s; }
.km-alert-card.on { border-color: var(--acento); box-shadow: 0 3px 12px rgba(15,17,21,.05); }
.km-alert-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.km-alert-name { font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.km-alert-desc { font-size: 12.5px; color: var(--muted); margin-top: 6px; flex: 1; line-height: 1.45; }
.km-alert-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.km-alert-ch { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.km-alert-vars { margin-top: 10px; font-size: 11.5px; color: var(--muted); line-height: 2; }
.km-var { background: var(--fill); border: none; border-radius: 8px; padding: 2px 6px; font-size: 11.5px; color: #334155; }

/* Tarjeta de config de email */
.km-ec-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink); flex-wrap: wrap; }
.km-ec-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.km-ec-badge { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.km-ec-badge.ok { background: var(--green-soft); color: #15803d; }
.km-ec-badge.warn { background: #fef3c7; color: #92400e; }

/* Modal de config de email — campos uniformes */
.km-ec-sec { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin: 4px 0 10px; }
.km-ec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
@media (max-width: 560px) { .km-ec-grid { grid-template-columns: 1fr; } }
.km-ec-fld { display: flex; flex-direction: column; gap: 6px; }
.km-ec-lbl { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.km-ec-grid .km-input, .km-ec-fld .km-input, .km-ec-testrow .km-input { height: 42px; box-sizing: border-box; }
.km-ec-testrow { display: flex; gap: 10px; align-items: center; }
.km-ec-testrow .km-input { flex: 1; }
.km-ec-testrow .km-btn-ghost { flex: 0 0 auto; white-space: nowrap; }
.km-ec-testnote { font-size: 11.5px; color: var(--muted); margin-top: 8px; }

/* Interruptor (switch) */
.km-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; cursor: pointer; }
.km-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.km-switch-track { position: absolute; inset: 0; background: #cbd3dc; border-radius: 22px; transition: background .18s; }
.km-switch-track::before { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.km-switch input:checked + .km-switch-track { background: var(--acento); }
.km-switch input:checked + .km-switch-track::before { transform: translateX(18px); }

/* Toast breve del panel */
.km-toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); background: #0f1115; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 13.5px; box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 9999; max-width: 90vw; }
.km-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.km-toast.err { background: #b91c1c; }

/* ── Vista Grupos: actividad + detalle ── */
.km-gact-list { display: flex; flex-direction: column; gap: 7px; }
.km-gact-row { display: grid; grid-template-columns: minmax(110px, 200px) 1fr 48px; align-items: center; gap: 12px; cursor: default; }
.km-gact-name { font-size: 12.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.km-gact-track { height: 9px; background: #eef2f7; border-radius: 6px; overflow: hidden; }
.km-gact-track i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #C2004D, #FF0066); transition: width .3s ease; }
.km-gact-val { text-align: right; font-weight: 700; font-size: 12.5px; color: var(--muted); }

/* Detalle: título + tarjetas de grupo dos en fila, con aire y separación del bloque de arriba */
.km-gdet-title { margin: 26px 2px 12px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); }
.km-gdet-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.km-gdet-row { display: flex; flex-direction: column; gap: 16px; padding: 20px 22px; background: var(--card, #fff); border: none; border-radius: var(--radius); box-shadow: none; }
.km-gdet-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.km-gdet-name { font-weight: 700; font-size: 15.5px; color: var(--ink); }
.km-gdet-metrics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.km-gdet-m { text-align: center; }
.km-gdet-m b { display: block; font-size: 17px; line-height: 1.1; }
.km-gdet-m span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; margin-top: 3px; display: block; }
@media (max-width: 900px) { .km-gdet-grid { grid-template-columns: 1fr; } }
@media (max-width: 620px) {
  .km-gact-row { grid-template-columns: 100px 1fr 44px; gap: 10px; }
  .km-gdet-metrics { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}

/* ── IA Recepción (editar + probar el prompt) ───────────────────────── */
.km-ia-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: stretch; margin-bottom: 18px; }
.km-ia-editor, .km-ia-test {
  background: #fff; border: 1px solid #e6e8eb; border-radius: 14px; padding: 18px;
  display: flex; flex-direction: column;
}
.km-ia-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.km-ia-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.km-ia-desc { margin: 0 0 12px; font-size: 13px; color: #667085; }
.km-ia-textarea {
  width: 100%; box-sizing: border-box; min-height: 360px; resize: vertical;
  border: 1px solid #dfe3e8; border-radius: 10px; padding: 12px; font-size: 13.5px;
  line-height: 1.5; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: #1f2933;
}
.km-ia-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.km-ia-count { font-size: 12px; color: #98a2b3; }
/* Información del club: campos estructurados con contador */
.km-ci-fld { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.km-ci-fld .km-ec-lbl { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.km-ci-count { font-size: 11px; font-weight: 600; color: #98a2b3; }
.km-ci-count.over { color: #b91c1c; }
.km-ci-ta { resize: vertical; min-height: 62px; line-height: 1.4; }
.km-ia-foot .km-cdet-note { flex: 1; margin: 0; }
.km-ia-status .km-ia-badge { font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 3px 10px; }
.km-ia-badge.on { background: #dcfce7; color: #15803d; }
.km-ia-badge.off { background: #f1f3f5; color: #667085; }
.km-ia-test { height: auto; min-height: 520px; }   /* iguala la altura de la tarjeta de la izquierda (align-items:stretch) */
.km-ia-msgs {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
  background: #efeae2; background-image: linear-gradient(rgba(240,236,228,0.92), rgba(240,236,228,0.92));
  border-radius: 10px; padding: 14px;
}
.km-ia-hint {
  align-self: center; max-width: 420px; text-align: center; color: #667781; font-size: 12.5px;
  line-height: 1.5; background: #fff; border-radius: 8px; padding: 12px 14px; box-shadow: 0 1px 0.5px rgba(0,0,0,.12);
}
.km-ia-bub {
  max-width: 78%; padding: 8px 11px; border-radius: 8px; font-size: 13.5px; line-height: 1.4;
  white-space: pre-wrap; word-break: break-word; box-shadow: 0 1px 0.5px rgba(0,0,0,.12);
}
.km-ia-bub.in { align-self: flex-start; background: #fff; color: #111; border-top-left-radius: 2px; }
.km-ia-bub.out { align-self: flex-end; background: #d9fdd3; color: #111; border-top-right-radius: 2px; }
/* Burbuja de un envío ya hecho: se puede pulsar para ver a qué grupos fue. Sin el cursor y sin el
   movimiento al pasar por encima nadie descubre que es pulsable — una ficha que no se encuentra es
   una ficha que no existe. */
.km-sm-clic { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.km-sm-clic:hover { transform: translateY(-1px); box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.km-ia-err { align-self: center; background: #fef2f2; color: #b91c1c; font-size: 12.5px; border-radius: 8px; padding: 8px 12px; }
.km-ia-input { display: flex; gap: 8px; margin-top: 12px; }
.km-ia-input .km-input { flex: 1; }
.km-ia-sendbtn {
  background: #25d366 !important; border-color: #25d366 !important; color: #fff !important;
  border-radius: 50% !important; width: 42px; height: 42px; min-width: 42px; padding: 0 !important;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.km-ia-sendbtn:hover { background: #1eb257 !important; border-color: #1eb257 !important; }
.km-ia-sendbtn svg { width: 22px; height: 22px; }
@media (max-width: 900px) { .km-ia-wrap { grid-template-columns: 1fr; } .km-ia-test { height: 460px; } }

/* Compartir partido: chat (izq) + opciones con toggles (der), a pantalla completa. */
.km-share-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; height: calc(100vh - 150px); min-height: 440px; }
/* La columna tiene alto fijo (es el alto de la pantalla), así que lo que no quepa SE DESPLAZA en vez
   de desbordarse: con "varias horas al día" abierto, el bloque de opciones puede pasar del alto en
   una pantalla de portátil. El chat de la izquierda no se ve afectado: su lienzo ya flexiona. */
.km-share-col { height: 100%; overflow-y: auto; }
.km-wa-opts { display: flex; flex-direction: column; }
.km-wa-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 4px; border-bottom: 1px solid #eef0f2; }
.km-wa-row-txt b { display: block; font-size: 14px; color: #16180f; }
.km-wa-row-txt span { display: block; font-size: 12px; color: #8a8a8a; margin-top: 2px; }
.km-wa-note { font-size: 11.5px; color: #8a8a8a; margin-top: 12px; }
/* Toggle estilo WhatsApp */
.km-switch { position: relative; width: 44px; height: 26px; flex: none; display: inline-block; }
.km-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.km-switch i { position: absolute; inset: 0; background: #ccd0d5; border-radius: 999px; transition: background .2s; }
.km-switch i::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .2s; }
.km-switch input:checked + i { background: #25d366; }
.km-switch input:checked + i::before { transform: translateX(18px); }
.km-switch.disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 900px) { .km-share-grid { grid-template-columns: 1fr; height: auto; } .km-share-col { height: 460px; } }

/* ── Capacidades de la IA (Recepción IA) ────────────────────────────── */
.km-caps-card { margin-top: 18px; background: #fff; border: 1px solid #e6e8eb; border-radius: 14px; padding: 18px; }
.km-caps-group { margin-top: 10px; }
.km-caps-group + .km-caps-group { margin-top: 18px; }
.km-caps-grouptitle { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #8a8a8a; margin-bottom: 4px; }
.km-caps-row { display: flex; align-items: center; gap: 13px; padding: 12px 4px; border-top: 1px solid #f0f2f4; cursor: pointer; }
.km-caps-row:first-of-type { border-top: none; }
.km-caps-row.soon { cursor: default; }
.km-caps-emoji { font-size: 20px; width: 26px; text-align: center; flex: none; }
.km-caps-txt { flex: 1; min-width: 0; }
.km-caps-txt b { display: block; font-size: 14px; color: #16180f; }
.km-caps-txt span { display: block; font-size: 12px; color: #8a8a8a; margin-top: 2px; }
.km-caps-soon { display: inline-block; margin-left: 8px; font-size: 10px; font-weight: 700; letter-spacing: .04em; color: #b98900; background: #fff4d6; border-radius: 6px; padding: 2px 6px; vertical-align: middle; }
.km-caps-row.soon .km-caps-txt b, .km-caps-row.soon .km-caps-txt span { color: #a0a4aa; }

/* ── Integraciones: pestañas por canal (estilo BreakPoint) ──────────── */
.km-int-tabs { display: inline-flex; gap: 4px; background: #eef1f4; border-radius: 12px; padding: 4px; margin: 2px 0 18px; }
.km-int-tabs button { display: inline-flex; align-items: center; gap: 7px; border: none; background: transparent; color: #6b7280; font: inherit; font-size: 14px; font-weight: 600; padding: 8px 16px; border-radius: 9px; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.km-int-tabs button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.km-int-tabs .km-int-tabico { display: inline-flex; width: 18px; height: 18px; }
.km-int-tabs .km-int-tabico svg { width: 18px; height: 18px; }

/* Banner de ayuda */
.km-int-help { display: flex; align-items: center; gap: 10px; background: #eef1f4; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: 13.5px; color: #4b5563; }
.km-int-help-ico svg, .km-int-help-ext svg { width: 18px; height: 18px; display: block; }
.km-int-help-ico { color: #6b7280; flex: none; }
.km-int-help-ext { margin-left: auto; color: #9aa2ad; flex: none; }
.km-int-help a { color: #2563eb; font-weight: 600; text-decoration: none; }
.km-int-help a:hover { text-decoration: underline; }

/* Tarjeta hero de WhatsApp API */
.km-int-wa { padding: 22px; }
.km-int-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.km-int-hero-l { display: flex; align-items: center; gap: 14px; min-width: 0; }
.km-int-logo { width: 48px; height: 48px; border-radius: 13px; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; flex: none; box-shadow: 0 2px 6px rgba(0,0,0,.10); }
.km-int-logo svg { width: 48px; height: 48px; display: block; }
.km-int-hero-txt { min-width: 0; }
.km-int-hero-txt b { display: block; font-size: 18px; color: #16180f; letter-spacing: -.2px; }
.km-int-hero-txt span { display: block; font-size: 13px; color: #8a8a8a; margin-top: 2px; }
.km-int-hero-r { flex: none; }

/* Caja de conexión */
.km-int-connbox { display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid #e6e8eb; border-radius: 12px; padding: 16px; margin-top: 18px; }
.km-int-connbox-txt { min-width: 0; }
.km-int-connbox-txt b { display: block; font-size: 15px; color: #16180f; }
.km-int-connbox-txt span { display: block; font-size: 13px; color: #8a8a8a; margin-top: 3px; }
.km-int-actions { display: flex; gap: 8px; flex: none; flex-wrap: wrap; justify-content: flex-end; }

/* Chips de estado */
.km-int-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.km-int-chip { display: inline-flex; align-items: center; gap: 6px; background: #f1f3f5; color: #4b5563; font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 20px; }
.km-int-chip b { font-weight: 700; color: #16180f; }
.km-int-chip .km-int-chipdot { width: 8px; height: 8px; border-radius: 50%; background: #cbd2da; }
.km-int-chip.on { background: var(--green-soft); color: #15803d; } .km-int-chip.on .km-int-chipdot { background: #22c55e; }
.km-int-chip.off { background: #fef3c7; color: #92400e; } .km-int-chip.off .km-int-chipdot { background: #f59e0b; }

/* Divisor + checklist de progreso */
.km-int-divider { height: 1px; background: #eef0f2; margin: 20px 0 16px; }
.km-int-steps-title { font-size: 15px; font-weight: 700; color: #16180f; margin-bottom: 10px; }
.km-int-steps { display: flex; flex-direction: column; gap: 10px; }
.km-int-step { display: flex; align-items: center; gap: 11px; font-size: 14px; color: #9aa2ad; }
.km-int-step.done { color: #374151; }
.km-int-stepico { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #dfe3e8; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.km-int-step.done .km-int-stepico { background: var(--green-soft); border-color: transparent; color: #15803d; }
.km-int-stepico svg { width: 14px; height: 14px; }

/* Banner ROI del bot (Resumen) */
.km-roi { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; background: linear-gradient(100deg, #f6ffe0 0%, #ffffff 60%); border: 1px solid #e3f0b8; }
.km-roi-l { display: flex; align-items: center; gap: 16px; min-width: 0; }
.km-roi-ico { width: 52px; height: 52px; border-radius: 14px; background: var(--acento); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; box-shadow: 0 2px 8px rgba(255,0,102,.4); }
.km-roi-ico svg { width: 26px; height: 26px; }
.km-roi-txt { min-width: 0; }
.km-roi-label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #C2004D; }
.km-roi-val { font-size: 32px; font-weight: 800; color: #16180f; line-height: 1.1; margin: 2px 0; letter-spacing: -.5px; }
.km-roi-sub { display: block; font-size: 13.5px; color: #4b5563; }
.km-roi-sub b { color: #16180f; }
.km-roi-extra { display: block; font-size: 12px; color: #86868b; margin-top: 3px; }
.km-roi-r { flex: none; }
@media (max-width: 640px) { .km-roi { flex-direction: column; align-items: flex-start; } .km-roi-r { align-self: stretch; } .km-roi-r button { width: 100%; justify-content: center; } }

/* ── Chats Playtomic (recepción, dos paneles) ───────────────────────── */
.pt-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.pt-filters { display: inline-flex; gap: 4px; background: #eef1f4; border-radius: 10px; padding: 4px; max-width: 100%; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.pt-filters::-webkit-scrollbar { display: none; }
.pt-filters button { flex: none; white-space: nowrap; }
.pt-filters button { border: none; background: transparent; color: #6b7280; font: inherit; font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 8px; cursor: pointer; }
.pt-filters button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.pt-search { flex: 1; min-width: 160px; font-size: 13px; }
.pt-typefilter { flex: none; width: auto; min-width: 150px; font-size: 13px; }
/* Móvil: los inputs no deben forzar anchura mínima que desborde grids/flex */
.km-input { min-width: 0; }
@media (max-width: 620px) {
  .pt-search { flex: 1 1 100%; }
  .pt-toolbar { gap: 8px; }
}
.pt-recep { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #4b5563; cursor: pointer; white-space: nowrap; }
.pt-gear { font-size: 12.5px !important; padding: 6px 10px !important; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.pt-gear svg { width: 15px; height: 15px; }
.pt-sug { margin-right: 5px; }
/* Alto: lo que queda de pantalla, no una fracción fija. Con 64vh sobraba hueco arriba y abajo y el
   chat se veía pequeño en monitores grandes. El 230px es lo que ocupan la cabecera del panel y la
   barra de filtros; el mínimo evita que en una ventana baja quede un chat de dos líneas. */
.pt-grid { display: grid; grid-template-columns: 340px 1fr; gap: 14px;
  height: calc(100vh - 230px); min-height: 520px; }
.pt-listcol { background: #fff; border: 1px solid #e6e8eb; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.pt-list { overflow: auto; flex: 1; }
.pt-item { padding: 11px 14px; border-bottom: 1px solid #f0f2f4; cursor: pointer; }
.pt-item:hover { background: #f7f9fb; }
.pt-item.active { background: #eef7ee; border-left: 3px solid var(--acento); padding-left: 11px; }
/* Urgencia por palabra clave: acento lateral + punto de color */
.pt-item.pt-urg-alta { box-shadow: inset 3px 0 0 #e5484d; }
.pt-item.pt-urg-media { box-shadow: inset 3px 0 0 #f0a020; }
.pt-item.pt-urg-baja { box-shadow: inset 3px 0 0 #2f80c4; }
.pt-item.active.pt-urg-alta, .pt-item.active.pt-urg-media, .pt-item.active.pt-urg-baja { box-shadow: none; }
.pt-urg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.pt-urg-dot-alta { background: #e5484d; }
.pt-urg-dot-media { background: #f0a020; }
.pt-urg-dot-baja { background: #2f80c4; }
/* Modal de palabras clave por urgencia */
.pt-kw-legend { display: flex; gap: 16px; margin-bottom: 12px; }
.pt-kw-leg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #6b7280; }
.pt-kw-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.pt-kw-rows { display: flex; flex-direction: column; gap: 8px; }
/* Fila con GRID (no flex) para ganar a `.km-modal-body .km-input{width:100%}` sin desbordar el modal */
.km-modal-body .pt-kw-row { display: grid; grid-template-columns: 1fr 118px 40px; gap: 8px; align-items: center; }
.km-modal-body .pt-kw-row .km-input { width: 100%; min-width: 0; }
.pt-kw-del { width: 40px; height: 38px; padding: 0; color: #b91c1c; display: inline-flex; align-items: center; justify-content: center; }
.pt-kw-del svg { width: 17px; height: 17px; }
.pt-kw-add { margin-top: 10px; }
.pt-item-row1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pt-item-name { font-size: 13px; font-weight: 600; color: #16180f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #25d366; color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.pt-item-row2 { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.pt-item-when { font-size: 11px; color: #667085; font-weight: 600; white-space: nowrap; flex: none; }
.pt-item-prev { font-size: 12px; color: #8a8a8a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.pt-item-prev.sys { font-style: italic; opacity: .7; }
.pt-type { font-size: 9.5px; font-weight: 700; letter-spacing: .03em; padding: 1px 6px; border-radius: 6px; flex: none; text-transform: uppercase; }
.pt-type-match { background: #e6f4ea; color: #15803d; }
.pt-type-tour  { background: #ede9fe; color: #6d28d9; }
.pt-type-book  { background: #e0f2fe; color: #0369a1; }
.pt-type-class { background: #fff4d6; color: #b45309; }
.pt-type-other { background: #eef1f4; color: #4b5563; }
.pt-convcol { background: #fff; border: 1px solid #e6e8eb; border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; }
.pt-empty { margin: auto; color: #9aa2ad; font-size: 14px; padding: 24px; text-align: center; }
/* Chat calcado del de Playtomic: fondo blanco-grisáceo, burbujas blancas a ambos lados (la del club con
   un tinte azul muy suave), y cada tanda del jugador con su columna [avatar redondo + nombre debajo] a
   la izquierda; los eventos de sistema como texto gris centrado. */
/* Fondo GRIS NEUTRO (R=G=B), como Playtomic. Antes #f3f4f6 tenía un punto azulado (tono WhatsApp Web,
   como el --bg #eef1f5 de la app). !important para que ningún estilo heredado del tema lo pise. */
.pt-msgs { flex: 1; overflow: auto; padding: 18px 18px; background: #f3f3f4 !important; display: flex; flex-direction: column; gap: 2px; }
/* Grupo = una tanda de mensajes del mismo remitente (columna de identidad + pila de burbujas). */
.pt-group { display: flex; align-items: flex-end; gap: 10px; max-width: 80%; margin: 6px 0 2px; }
.pt-group.in { align-self: flex-start; }
.pt-group.out { align-self: flex-end; }
.pt-idcol { flex: none; width: 46px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pt-idcol .pt-avatar { width: 36px; height: 36px; }
.pt-idname { font-size: 11px; color: #8a94a6; text-align: center; line-height: 1.1; max-width: 52px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-stack { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pt-bubble { max-width: 100%; padding: 9px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.4; position: relative; word-wrap: break-word; background: #fff; box-shadow: 0 1px 1.5px rgba(16,24,40,.07); }
.pt-group.in .pt-bubble { border-bottom-left-radius: 4px; }
.pt-group.out .pt-bubble { background: #eaf1fb; border-bottom-right-radius: 4px; }
.pt-btime { display: block; font-size: 10px; color: #aab2c0; text-align: right; margin-top: 3px; font-style: normal; }
.pt-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 700; }
/* Evento de sistema (se unió/salió): texto gris centrado, sin pastilla ni avatar, como Playtomic. */
.pt-sysmsg { align-self: center; font-size: 12px; color: #98a2b3; text-align: center; margin: 8px 0; max-width: 90%; }
/* Barra de respuesta estilo Playtomic: input redondeado a la izquierda + botón azul "Enviar" a la derecha. */
.pt-reply { border-top: 1px solid #eef0f2; padding: 12px 16px; background: #fff; }
.pt-reply-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.pt-sug-tag { font-size: 11px; font-weight: 700; color: #7c5cff; margin-left: 6px; }
.pt-dismiss { font-size: 12px; }
.pt-tpls { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pt-tpl { font-size: 11.5px; padding: 4px 10px; border: 1px solid #d7dbe0; background: #f7f9fb; color: #4b5563; border-radius: 14px; cursor: pointer; }
.pt-tpl:hover { background: #eef2f6; }
.pt-reply textarea { width: 100%; resize: none; font-size: 14px; border: 1px solid #d7dbe0; border-radius: 22px;
  padding: 11px 16px; line-height: 1.35; outline: none; transition: border-color .15s;
  /* Acotada: con la caja alta, la conversación —que es lo que se viene a leer— quedaba en una franja. */
  min-height: 44px; max-height: 110px; overflow-y: auto; }
.pt-reply textarea:focus { border-color: #2f6bff; box-shadow: 0 0 0 3px rgba(47,107,255,.12); }
.pt-reply-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
/* Botón "Enviar" calcado al de Playtomic: fondo BLANCO, texto/icono AZUL y borde azul (no relleno).
   Lleva !important en lo clave para ganar a los estilos globales de <button> del tema de WordPress
   (antes llevaba la clase .km-btn-primary, que lo forzaba a negro). */
.pt-send-btn { display: inline-flex; align-items: center; gap: 8px; background: #fff !important; color: #2f6bff !important; border: 1px solid #2f6bff !important; border-radius: 10px; padding: 9px 20px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.pt-send-btn:hover:not(:disabled) { background: #f0f5ff !important; color: #1e56e6 !important; border-color: #1e56e6 !important; }
.pt-send-btn:disabled { opacity: .55; cursor: default; }
.pt-send-btn svg { width: 16px; height: 16px; }
.pt-warn { font-size: 11px; color: #b45309; margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.pt-warn svg { width: 14px; height: 14px; flex: none; }
@media (max-width: 860px) {
  .pt-grid { grid-template-columns: 1fr; height: auto; }
  .pt-listcol { height: 340px; }
  /* Conversación grande y legible en móvil (antes se veía diminuta). */
  .pt-convcol { height: 72vh; min-height: 520px; }
  .pt-msgs { padding: 12px 12px 16px; gap: 2px; }
  .pt-group { max-width: 90%; }
  .pt-bubble { font-size: 15px; line-height: 1.4; padding: 9px 13px; }
  .pt-idname { font-size: 11px; }
  .pt-btime { font-size: 11px; }
  .pt-head-t b { font-size: 15px; }
}

/* Nota al pie */
.km-int-foot { display: flex; align-items: flex-start; gap: 10px; font-size: 12.5px; color: #8a8a8a; margin-top: 16px; padding: 0 4px; }
.km-int-foot-ico { color: #9aa2ad; flex: none; margin-top: 1px; }
.km-int-foot-ico svg { width: 16px; height: 16px; display: block; }

@media (max-width: 640px) {
  .km-int-connbox { flex-direction: column; align-items: stretch; }
  .km-int-actions { justify-content: stretch; }
  .km-int-actions button { flex: 1; justify-content: center; }
  .km-int-hero { flex-direction: column; }
  .km-int-hero-r { align-self: flex-start; }
}

/* ── Editor de opciones del menú principal (Recepción IA) ───────────── */
.km-menu-card { margin-top: 18px; background: #fff; border: 1px solid #e6e8eb; border-radius: 14px; padding: 18px; }
.km-menu-row {
  display: grid; grid-template-columns: 64px 1fr 2fr 36px; gap: 10px; align-items: start;
  padding: 10px 0; border-top: 1px solid #f0f2f4;
}
.km-menu-row:first-child { border-top: none; }
.km-menu-emoji { text-align: center; }
.km-menu-resp { resize: vertical; min-height: 38px; font-family: inherit; }
.km-menu-del {
  width: 34px; height: 34px; padding: 0; border-radius: 8px; align-self: center;
  color: #b91c1c; font-size: 15px; line-height: 1;
}
/* Palabras clave: ocupan toda la fila, debajo de los demás campos de la opción. */
.km-menu-kw { grid-column: 1 / -1; font-size: 13px; }
@media (max-width: 720px) {
  .km-menu-row { grid-template-columns: 56px 1fr 34px; }
  .km-menu-resp { grid-column: 1 / -1; }
}

/* Recepcionista IA + "Qué puede hacer el bot", una al lado de otra (media anchura cada una).
   Las filas no ocupan lo mismo en las dos tarjetas, así que se alinean arriba en vez de estirarse. */
/* Horas elegidas para una programación diaria (chips con su aspa) */
.km-msg-times { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
/* Pastilla de hora estilo Apple/WhatsApp: fondo gris suave, texto oscuro, × redondo pequeño. */
.km-msg-time { display: inline-flex; align-items: center; gap: 7px; background: #eceef1 !important; border: none; border-radius: 999px; padding: 6px 7px 6px 13px; font-size: 13.5px; font-weight: 600; color: #16180f; }
.km-msg-time-del { display: inline-flex !important; align-items: center; justify-content: center; width: 18px; height: 18px; min-width: 18px !important; border: none !important; border-radius: 50% !important; background: #c9ced6 !important; color: #41474f !important; cursor: pointer; font-size: 12px !important; line-height: 1 !important; padding: 0 !important; margin: 0 !important; box-shadow: none !important; text-transform: none !important; letter-spacing: normal !important; font-weight: 700 !important; transition: background .15s, color .15s; }
.km-msg-time-del:hover { background: #e5484d !important; color: #fff !important; }

/* "Cuándo": UNA elección de tres (ahora / un día y una hora / varias horas al día), con lo que hace
   cada una escrito al lado. Sustituye al interruptor "programar para más tarde" + desplegable
   "cómo", que eran dos pasos para decir una cosa y había que abrirlos para ver qué estaba puesto. */
.km-msg-cuando { display: flex; flex-direction: column; flex: none; gap: 8px; margin: 4px 0 6px; }
#km-panel-container .km-msg-cuando label {
  display: flex; align-items: flex-start; gap: 11px; padding: 11px 13px; cursor: pointer;
  background: #f7f9fb; border: 1.5px solid #e6e9ed; border-radius: 11px;
  transition: border-color .15s, background .15s;
}
#km-panel-container .km-msg-cuando label:hover { border-color: #ccd3da; }
#km-panel-container .km-msg-cuando input { margin: 2px 0 0; flex: none; width: 17px; height: 17px; accent-color: #16180f; }
.km-msg-cuando b { display: block; font-size: 14px; color: #16180f; }
.km-msg-cuando em { display: block; font-size: 12px; color: #8a8a8a; font-style: normal; margin-top: 2px; }
/* La elegida se ve de un vistazo sin fijarse en el punto del radio. Si el navegador no entiende
   `:has`, el propio radio sigue marcando cuál es: no se queda nada sin indicar. */
#km-panel-container .km-msg-cuando label:has(input:checked) { background: #f3f8ea; border-color: #FF0066; }

/* El "al" entre las dos fechas del periodo. No usa .km-cdet-note: esa es una nota con fondo y
   relleno, y para dos letras entre dos campos salía una caja gris enorme. */
.km-msg-al { font-size: 12.5px; color: var(--muted); }

/* El cartel de "qué va a pasar al pulsar el botón", justo debajo del botón. Verde = sale ya,
   ámbar = se programa, rojo = esa combinación no vale (y por qué). */
.km-msg-plan { flex: none; margin-top: 8px; padding: 9px 12px; border-radius: 9px; font-size: 12.5px; line-height: 1.45; background: #f1f6e4; color: #41473a; border: 1px solid #e4eecd; }
.km-msg-plan.prog { background: #fff7e6; color: #6b4e14; border-color: #f3e2bd; }
/* Gris = todavía falta rellenarlo (no es culpa de nadie); rojo = esa combinación no vale. */
.km-msg-plan.falta { background: #f7f9fb; color: #6c747d; border-color: #e6e9ed; }
.km-msg-plan.mal  { background: #fef2f2; color: #b91c1c; border-color: #fadcdc; }
/* Programar NO es enviar: el botón deja el verde de WhatsApp y pasa a calendario ámbar, para que
   nadie pulse el avión de papel creyendo que sale ahora cuando está programado. */
#km-panel-container .km-ia-sendbtn.prog { background: #f0a92b !important; border-color: #f0a92b !important; }
#km-panel-container .km-ia-sendbtn.prog:hover { background: #d9951c !important; border-color: #d9951c !important; }

/* Burbuja de un envío PROGRAMADO: se distingue de uno ya enviado (sin doble tick, con reloj) */
.km-wa-sched { opacity: .88; border: 1px dashed #b9c4a0; }
.km-wa-schedmeta { color: #C2004D !important; font-weight: 600; }
/* Un envío que NO salió: ni doble tick ni reloj verde. Si se pinta como entregado, el club cree
   que sus grupos lo tienen (reportado el 6 oct 2026, con un envío fallido mostrando doble tick). */
.km-wa-sched.mal { border-color: #e5a3a3; background: #fff5f5; }
.km-wa-sched.mal .km-wa-schedmeta { color: #b91c1c !important; }

.km-svc-waiting { background: #fff8e6; border: 1px solid #f0e0b0; border-radius: 10px; padding: 9px 11px; margin: 4px 0 2px; }
/* `stretch` (no `start`): las dos tarjetas de Recepción IA van emparejadas y con `start` cada una
   tomaba su alto natural, así que quedaban desiguales. */
.km-recep-wrap { align-items: stretch; }
.km-recep-wrap > .km-card { margin-bottom: 0; }

/* ── Recepcionista IA: secciones por opción + candado (solo lectura) ── */
.km-caps-ico { width: 26px; height: 26px; flex: none; color: #16180f; display: inline-flex; align-items: center; justify-content: center; }
.km-caps-ico svg { width: 21px; height: 21px; }
.km-caps-ico { width: 26px; height: 26px; flex: none; color: #16180f; display: inline-flex; align-items: center; justify-content: center; }
.km-caps-ico svg { width: 21px; height: 21px; }
.km-recep-sectitle { font-size: 14px; font-weight: 600; color: #16180f; }
.km-lock-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: #6b5900; background: #fff4d6; border: 1px solid #f2e3a8; border-radius: 999px; padding: 3px 9px 3px 7px; white-space: nowrap; }
.km-lock-badge svg { width: 13px; height: 13px; }

/* Filas compactas de la Recepción IA: título+desc a la izq, botón-resumen a la dcha */
.km-recep-sec-row { display: flex; align-items: center; gap: 16px; border-top: 1px solid #eef0f2; padding: 20px 2px; }
.km-recep-sec-row:first-of-type { border-top: none; padding-top: 10px; }
.km-recep-sec-row:last-of-type { padding-bottom: 10px; }
.km-recep-secmain { flex: 1; min-width: 0; }
.km-recep-secmain .km-cdet-note { margin-top: 2px; }
.km-sched-summary { display: inline-flex; align-items: center; gap: 6px; flex: none; max-width: 220px; background: #fff; border: 1px solid #d7dbe0; border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600; color: #16180f; cursor: pointer; }
.km-sched-summary > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.km-sched-summary:hover { border-color: #16180f; }
.km-sched-summary:disabled { cursor: not-allowed; color: #b0b6bd; background: #f4f5f7; border-color: #e6e8eb; }
.km-sched-summary:disabled svg { color: #cbd0d6; }
.km-sched-summary svg { width: 15px; height: 15px; color: #98a2b3; flex: none; }
.km-sched-sep { color: #98a2b3; }

/* Mini-modal Notificar: lista de teléfonos editable */
.km-phlist { display: flex; flex-direction: column; gap: 8px; }
.km-phrow { display: flex; align-items: center; gap: 8px; }
.km-phrow .km-ph { flex: 1; }
.km-ph-del { width: 38px; height: 38px; padding: 0; flex: none; border-radius: 9px; color: #b91c1c; display: inline-flex; align-items: center; justify-content: center; }
.km-ph-del svg { width: 17px; height: 17px; }
.km-ph-add { margin-top: 10px; color: #16a34a; font-weight: 600; }
@media (max-width: 560px) { .km-sched-summary { max-width: 150px; } }

/* Modal del horario activo (por día) */
.km-schm-rows { display: flex; flex-direction: column; }
.km-schm-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid #eef0f2; }
.km-schm-row:first-child { border-top: none; }
.km-schm-day { font-size: 14px; font-weight: 600; color: #16180f; }
.km-schm-ctl { display: flex; align-items: center; gap: 8px; }
.km-schm-mode { min-width: 172px; }
.km-schm-times { display: inline-flex; align-items: center; gap: 6px; }
.km-schm-times .km-input { width: 96px; }
@media (max-width: 560px) {
  .km-schm-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .km-schm-ctl { flex-wrap: wrap; }
  .km-schm-mode { min-width: 148px; }
}

/* ── "No responder a" (antes Contactos bloqueados) ──────────────────── */
.km-block-card { margin-top: 18px; background: #fff; border: 1px solid #e6e8eb; border-radius: 14px; padding: 18px; }
.km-block-card .km-ia-head { display: flex; align-items: center; gap: 10px; }
.km-block-add { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.km-block-add .km-input { flex: 1; min-width: 140px; }
.km-block-row {
  display: grid; grid-template-columns: 160px 1fr 34px; gap: 10px; align-items: center;
  padding: 9px 0; border-top: 1px solid #f0f2f4; font-size: 13.5px;
}
.km-block-row:first-child { border-top: none; }
.km-block-phone { font-weight: 600; font-family: ui-monospace, Menlo, Consolas, monospace; }
.km-block-reason { color: #667085; }
.km-block-del { width: 32px; height: 32px; padding: 0; border-radius: 8px; color: #b91c1c; }
@media (max-width: 720px) { .km-block-row { grid-template-columns: 1fr 34px; } .km-block-reason { grid-column: 1 / -1; } }

/* Paginador de contactos bloqueados */
.km-block-pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding-top: 12px; margin-top: 6px; border-top: 1px solid #f0f2f4; }
.km-block-pager .km-btn-ghost[disabled] { opacity: .4; cursor: default; }
.km-block-pageinfo { font-size: 12.5px; color: #667085; }

/* ── Cabecera del chat y pestañas ───────────────────────────────────────────────
   La cabecera es de UNA línea a propósito: todo el contexto del partido/pozo vive en las pestañas.
   Con los datos arriba, la cabecera crecía con cada campo nuevo y se comía la conversación. */
.pt-head { display: flex; align-items: flex-start; gap: 12px; padding: 11px 16px 8px; }
.pt-head-t { flex: 1; min-width: 0; }
.pt-head-t b { font-size: 14.5px; color: #16180f; }
.pt-head-sub { display: block; font-size: 12.5px; color: #78808d; margin-top: 3px; }
.pt-head-sub .falta { color: #b45309; font-weight: 700; }
.pt-head-acts { display: flex; gap: 6px; flex: none; align-items: center; }

/* ⚠️ El panel vive DENTRO de un WordPress con el tema del club, que estila `button` a su manera
   (fondo de color, radios, sombras). Sin resetear a la fuerza, estos botones salían como cuadrados
   verdes. Por eso van con !important: no es pereza, es que compiten con un CSS que no controlamos. */
#km-panel-container .pt-ico, .pt-ico {
  -webkit-appearance: none !important; appearance: none !important;
  width: 30px !important; height: 30px !important; min-width: 0 !important; min-height: 0 !important;
  flex: none; padding: 0 !important; margin: 0 !important;
  border: 0 !important; border-radius: 50% !important;
  background: rgba(118,118,128,.10) !important; color: #3a4150 !important;
  box-shadow: none !important; text-shadow: none !important; text-decoration: none !important;
  display: inline-flex !important; align-items: center; justify-content: center;
  cursor: pointer; font-family: inherit; line-height: 1 !important;
  transition: background .15s ease, color .15s ease, transform .1s ease;
}
.pt-ico:hover { background: rgba(118,118,128,.18) !important; color: #12141a !important; }
.pt-ico:active { transform: scale(.93); }
.pt-ico:focus-visible { outline: 2px solid var(--blue, #0a84ff); outline-offset: 2px; }
.pt-ico[disabled] { opacity: .4; cursor: default; }
.pt-ico svg { width: 15px !important; height: 15px !important; display: block; }
/* ⚠️ El prefijo #km-panel-container de la regla de arriba hace que ESTA tenga que llevarlo también:
   con `!important` en las dos, decide la especificidad, y un id (1,1,0) gana a clase+atributo (0,2,0).
   Sin esto, `hidden` no escondía nada — el botón de compartir seguía saliendo con el interruptor
   apagado en el bot. */
#km-panel-container .pt-ico[hidden], .pt-ico[hidden] { display: none !important; }
/* "Resuelto" activo: verde, para distinguirlo de un botón normal de un vistazo. */
#km-panel-container .pt-ico.pt-resolve.on, .pt-ico.pt-resolve.on {
  background: var(--green-soft) !important;
  color: #15803d !important;
}

/* Pestañas: control segmentado, al estilo de iOS. Un carril gris con la pestaña activa en blanco. */
/* ── Nota del chat, compartida por todo el club ────────────────────────────────────────────────── */
.pt-note { padding: 0 16px 10px; }
.pt-note textarea { width: 100%; resize: vertical; min-height: 62px; max-height: 180px; font-family: inherit;
  font-size: 13.5px; line-height: 1.45; border: 1px solid #e6d9a8; border-radius: 10px; padding: 9px 12px;
  background: #fffdf2; color: #3a3524; outline: none; }
.pt-note textarea:focus { border-color: #FF0066; box-shadow: 0 0 0 3px rgba(255,0,102,.2); }
.pt-note-bar { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.pt-note-meta { flex: 1; min-width: 0; font-size: 11.5px; color: #78808d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Mismo reseteo y mismo lenguaje que las pestañas y los iconos del chat: el tema de WordPress estila
   `button` a su manera y, sin esto, "Guardar nota" salía como un bloque verde del tema.
   ⚠️ El `display` explícito gana al atributo `hidden` (que es una regla del navegador, no de autor),
   así que hay que repetirlo en `[hidden]`: por eso "Borrar" se veía en chats SIN nota. */
#km-panel-container .pt-note-bar button, .pt-note-bar button {
  -webkit-appearance: none !important; appearance: none !important;
  border: 0 !important; border-radius: 980px !important;
  box-shadow: none !important; text-shadow: none !important;
  padding: 7px 16px !important; margin: 0 !important; min-height: 0 !important;
  font-family: inherit; font-size: 12.5px !important; font-weight: 600 !important; line-height: 1.4 !important;
  cursor: pointer; flex: none; white-space: nowrap;
  transition: background .15s ease, color .15s ease, transform .1s ease;
}
/* ⚠️ El prefijo #km-panel-container de la regla de arriba hace que ESTA tenga que llevarlo también:
   con `!important` en las dos, decide la especificidad, y un id (1,1,0) gana a clase+atributo (0,2,0).
   Sin esto, `hidden` no escondía nada — el botón de compartir seguía saliendo con el interruptor
   apagado en el bot. */
#km-panel-container .pt-note-bar button[hidden], .pt-note-bar button[hidden] { display: none !important; }
.pt-note-bar button:active { transform: scale(.97); }
.pt-note-bar button[disabled] { opacity: .5; cursor: default; }
/* Guardar: la acción. Borrar: discreta, que es destructiva y no debe competir por el clic. */
#km-panel-container #pt-note-save, #pt-note-save { background: var(--blue, #0a84ff) !important; color: #fff !important; }
#pt-note-save:hover { filter: brightness(1.08); }
#km-panel-container #pt-note-del, #pt-note-del { background: rgba(118,118,128,.12) !important; color: #3a4150 !important; }
#pt-note-del:hover { background: rgba(255,59,48,.12) !important; color: #c0392b !important; }
/* El punto del icono: con nota escrita se ve sin abrir nada. */
.pt-note-btn { position: relative; }
.pt-note-dot { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--orange, #f97316); box-shadow: 0 0 0 2px #fff; }
.pt-note-dot[hidden] { display: none !important; }
.pt-item-note { display: inline-flex; vertical-align: -2px; margin-right: 4px; color: #b45309; }
.pt-item-note svg { width: 12px; height: 12px; }

.pt-tabs { display: flex; gap: 2px; margin: 0 16px 8px; padding: 2px !important;
  background: rgba(118,118,128,.12); border-radius: 9px; align-self: flex-start; }
#km-panel-container .pt-tab, .pt-tab {
  -webkit-appearance: none !important; appearance: none !important;
  border: 0 !important; border-radius: 7px !important;
  background: transparent !important; box-shadow: none !important; text-shadow: none !important;
  padding: 5px 14px !important; margin: 0 !important; min-height: 0 !important;
  font-family: inherit; font-size: 13px !important; font-weight: 600 !important; line-height: 1.5 !important;
  color: #5a6068 !important; cursor: pointer; white-space: nowrap;
  display: inline-flex !important; align-items: center; gap: 6px;
  transition: background .15s ease, color .15s ease;
}
.pt-tab:hover { color: #12141a !important; }
#km-panel-container .pt-tab[aria-selected="true"], .pt-tab[aria-selected="true"] {
  background: #fff !important; color: #12141a !important;
  box-shadow: 0 1px 3px rgba(16,24,40,.12), 0 0 0 .5px rgba(16,24,40,.04) !important;
}
/* `display:…!important` de arriba gana al atributo `hidden`, así que hay que decirlo aquí también:
   sin esto, la pestaña de Jugadores seguía saliendo en los chats privados. */
/* ⚠️ El prefijo #km-panel-container de la regla de arriba hace que ESTA tenga que llevarlo también:
   con `!important` en las dos, decide la especificidad, y un id (1,1,0) gana a clase+atributo (0,2,0).
   Sin esto, `hidden` no escondía nada — el botón de compartir seguía saliendo con el interruptor
   apagado en el bot. */
#km-panel-container .pt-tab[hidden], .pt-tab[hidden] { display: none !important; }
.pt-tab .n { font-size: 10.5px !important; font-weight: 700 !important; min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 9px; background: #25d366; color: #fff !important;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1 !important; }
/* El contenedor del chat es flex en columna: el panel activo es el que estira. */
.pt-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pt-pane[hidden] { display: none !important; }

/* ── La ficha: bloques visuales, no listas de clave/valor ──────────────────────── */
.pt-body { flex: 1; overflow: auto; padding: 18px 16px 20px; display: flex; flex-direction: column; gap: 18px; }
.pt-cardmsg { font-size: 13px; color: #78808d; line-height: 1.55; }

/* Ocupación: la pregunta que trae a recepción al chat, arriba y en grande. */
.pt-body .oc { display: flex; align-items: center; gap: 16px; }
.pt-body .oc-n { font-size: 34px; font-weight: 800; letter-spacing: -1.5px; line-height: 1; font-variant-numeric: tabular-nums; }
.pt-body .oc-n small { font-size: 16px; font-weight: 700; color: #78808d; letter-spacing: 0; }
.pt-body .oc-r { flex: 1; min-width: 0; }
.pt-body .oc-slots { display: flex; gap: 5px; margin-bottom: 7px; }
.pt-body .oc-slots i { height: 9px; flex: 1; border-radius: 999px; background: var(--acento-osc); }
.pt-body .oc-slots i.libre { background: #fde0c8; box-shadow: inset 0 0 0 1px #f8c89e; }
.pt-body .oc-txt { font-size: 13px; color: #3a4150; }
.pt-body .oc-txt b { color: #b45309; }

/* Datos: pocos, grandes, con la etiqueta encima. */
.pt-body .gd { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 1px; background: #f0f2f5;
  border: 1px solid #f0f2f5; border-radius: 12px; overflow: hidden; }
.pt-body .gd > div { background: #fff; padding: 11px 13px; }
.pt-body .gd span { display: block; font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: #78808d; font-weight: 700; margin-bottom: 4px; }
.pt-body .gd b { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.pt-body .gd b small { font-size: 12px; color: #78808d; font-weight: 600; }

/* Línea de tiempo: creado → cierra → juega. Cuenta la historia en vez de listar tres fechas. */
.pt-body .tl { display: flex; align-items: stretch; }
.pt-body .tl-p { flex: 1; padding-left: 15px; position: relative; }
.pt-body .tl-p::before { content: ''; position: absolute; left: 0; top: 4px; width: 9px; height: 9px; border-radius: 50%;
  background: #cdd3da; box-shadow: 0 0 0 3px #fff; }
.pt-body .tl-p::after { content: ''; position: absolute; left: 4px; top: 13px; bottom: -4px; width: 1px; background: #e6eaef; }
.pt-body .tl-p:last-child::after { display: none; }
.pt-body .tl-p.on::before { background: var(--acento-osc); box-shadow: 0 0 0 3px rgba(194,0,77,.14); }
.pt-body .tl-p span { display: block; font-size: 11px; color: #78808d; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.pt-body .tl-p b { font-size: 13px; font-weight: 650; }

.pt-body .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-body .eq { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #78808d; font-weight: 700; margin-bottom: 8px; }

/* Jugadores: una tarjeta cada uno, agrupados por equipo. */
.pt-body .jg { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid #e6eaef; border-radius: 12px; background: #fff; }
.pt-body .jg + .jg { margin-top: 7px; }
.pt-body .jg-n { flex: 1; min-width: 0; }
.pt-body .jg-n b { display: block; font-size: 14px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-body .jg-n span { font-size: 12px; color: #78808d; }
.pt-body .jg-lvl { font-size: 13px; font-weight: 700; color: #12141a; background: #f2f5f8; border-radius: 999px; padding: 4px 11px;
  flex: none; font-variant-numeric: tabular-nums; }
/* Solo se marca a quien debe de verdad: con SINGLE_PAYER paga uno por todos y los demás NO deben nada. */
.pt-body .jg.debe { border-color: #f3d2b3; background: #fffaf5; }
.pt-body .jg.libre { border-style: dashed; background: #fffaf5; border-color: #f3d2b3; }
.pt-body .jg.libre .pt-avatar { background: #fff; color: #c2410c; border: 1px dashed #f0b887; font-size: 18px; }
.pt-body .jg.libre .jg-n b { color: #b45309; }
/* Mismo motivo que .pt-ico: compite con el `button` del tema de WordPress. */
#km-panel-container .pt-body .btn-min, .pt-body .btn-min {
  -webkit-appearance: none !important; appearance: none !important;
  border: 0 !important; border-radius: 980px !important;
  background: var(--blue, #0a84ff) !important; color: #fff !important;
  box-shadow: none !important; text-shadow: none !important;
  padding: 7px 15px !important; margin: 0 !important; min-height: 0 !important;
  font-family: inherit; font-size: 12.5px !important; font-weight: 600 !important; line-height: 1.4 !important;
  cursor: pointer; flex: none; transition: filter .15s ease, transform .1s ease;
}
.pt-body .btn-min:hover { filter: brightness(1.08); }
.pt-body .btn-min:active { transform: scale(.97); }
#km-panel-container .pt-body .btn-min[hidden], .pt-body .btn-min[hidden] { display: none !important; }
.pt-body .btn-min[disabled] { opacity: .5; cursor: default; }
.pt-body .pago { display: flex; align-items: center; gap: 9px; padding: 10px 13px; border-radius: 12px; font-size: 13px; }
.pt-body .pago svg { width: 17px; height: 17px; flex: none; }
.pt-body .pago.ok { background: var(--green-soft); color: #15803d; }
.pt-body .pago.debe { background: #fff4d6; color: #b45309; }

/* Interés del pozo: lo construye el bot comparando consultas; Playtomic NO lo enseña. */
.pt-body .int { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: #f0f2f5;
  border: 1px solid #f0f2f5; border-radius: 12px; overflow: hidden; }
.pt-body .int > div { background: #fff; padding: 11px 13px; text-align: center; }
.pt-body .int span { display: block; font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: #78808d; font-weight: 700; margin-bottom: 4px; }
.pt-body .int b { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pt-body .int b.baja { color: #dc2626; }
.pt-body .curva { display: flex; align-items: flex-end; gap: 3px; height: 54px; margin-top: 12px; }
.pt-body .curva i { flex: 1; min-width: 3px; background: #ffc2d9; border-radius: 3px 3px 0 0; display: block; }
.pt-body .curva i.pico { background: var(--orange); }
.pt-body .curva i.hoy { background: var(--acento-osc); }
.pt-body .curva-pie { display: flex; justify-content: space-between; font-size: 11.5px; color: #78808d; margin-top: 5px; }
.pt-body .lectura { font-size: 13px; line-height: 1.55; color: #3a4150; background: #fbfdf2; border: 1px solid #e9f0cf;
  border-radius: 12px; padding: 11px 13px; }

@media (max-width: 640px) {
  .pt-head-acts { gap: 4px; }
  .pt-ico { width: 32px; height: 32px; }
  .pt-tab { margin-right: 14px; font-size: 13px; }
  .pt-body { padding: 14px 13px 18px; gap: 15px; }
  .pt-body .oc-n { font-size: 28px; }
}

/* ── "Compartir mensajes": redacción, grupos de nivel y cola de envíos ───────── */
.km-msg-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }

/* ── Simulación de WhatsApp: cabecera, lienzo, burbuja y barra de redacción ── */
.km-wa-head {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  background: #f0f2f5; border: 1px solid #e6e8eb; border-bottom: none; border-radius: 10px 10px 0 0;
}
.km-wa-avatar {
  width: 34px; height: 34px; flex: none; border-radius: 50%; background: #25d366; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.km-wa-avatar svg { width: 19px; height: 19px; }
.km-wa-headtxt { display: flex; flex-direction: column; min-width: 0; }
.km-wa-headtxt b { font-size: 13.5px; color: #111b21; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.km-wa-headtxt span { font-size: 11.5px; color: #667781; }
/* Fondo del chat: el punteado de WhatsApp, hecho con degradados (sin imágenes externas). */
.km-wa-canvas {
  flex: 1; min-height: 220px; overflow-y: auto; padding: 16px 14px; border: 1px solid #e6e8eb;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  background-color: #efeae2;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0,0,0,.022) 1.5px, transparent 1.6px),
    radial-gradient(circle at 70% 65%, rgba(0,0,0,.022) 1.5px, transparent 1.6px);
  background-size: 46px 46px, 62px 62px;
}
.km-wa-empty {
  align-self: center; margin: auto 0; max-width: 300px; text-align: center; color: #667781;
  font-size: 12.5px; line-height: 1.5; background: #fff; border-radius: 8px; padding: 12px 14px;
  box-shadow: 0 1px 0.5px rgba(0,0,0,.12);
}
.km-wa-bub {
  position: relative; align-self: flex-end; max-width: 82%; min-width: 92px;
  background: #d9fdd3; border-radius: 8px; border-top-right-radius: 2px; padding: 4px 8px 5px 6px;
  box-shadow: 0 1px 0.5px rgba(0,0,0,.13); font-size: 14px; line-height: 1.38; color: #111b21;
}
.km-wa-txt { padding: 2px 4px 0 3px; word-break: break-word; }
.km-wa-txt code { font-size: 12.5px; background: rgba(0,0,0,.05); border-radius: 3px; padding: 0 3px; }
.km-wa-link { color: #027eb5; text-decoration: underline; word-break: break-all; }
.km-wa-pics { display: grid; gap: 3px; border-radius: 6px; overflow: hidden; }
.km-wa-pics.multi { grid-template-columns: 1fr 1fr; }
.km-wa-pics img { width: 100%; max-height: 260px; object-fit: cover; display: block; }
.km-wa-pics.multi img { max-height: 130px; }
.km-wa-meta {
  display: flex; align-items: center; justify-content: flex-end; gap: 3px;
  font-size: 11px; color: #667781; margin-top: 1px; padding-right: 2px;
}
.km-wa-tick { width: 15px; height: 11px; fill: #53bdeb; flex: none; }
.km-wa-compose {
  display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px;
  background: #f0f2f5; border: 1px solid #e6e8eb; border-top: none; border-radius: 0 0 10px 10px;
}
.km-wa-clip { flex: none; width: 34px; height: 34px; border-radius: 50%; color: #54656f; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; }
.km-wa-clip:hover { background: rgba(0,0,0,.05); }
.km-wa-clip svg { width: 21px; height: 21px; }
.km-wa-input {
  flex: 1; border: none; border-radius: 8px; background: #fff; padding: 9px 12px; resize: none;
  font-family: inherit; font-size: 14px; line-height: 1.35; color: #111b21; max-height: 130px; overflow-y: auto;
}
.km-wa-input:focus { outline: none; box-shadow: 0 0 0 2px rgba(37,211,102,.25); }
.km-msg-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.km-msg-thumb { position: relative; width: 74px; height: 74px; border-radius: 10px; overflow: hidden; border: 1px solid #e6e8eb; }
.km-msg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Quitar foto: el mismo botón redondo del resto del panel. Con el reseteo a la fuerza, que el tema
   de WordPress estila `button` y lo pintaba como un bloque verde encima de la miniatura. */
#km-panel-container .km-msg-thumbdel, .km-msg-thumbdel {
  -webkit-appearance: none !important; appearance: none !important;
  position: absolute; top: 4px; right: 4px;
  width: 22px !important; height: 22px !important; min-width: 0 !important; min-height: 0 !important;
  padding: 0 !important; margin: 0 !important; line-height: 1 !important;
  border: 0 !important; border-radius: 50% !important;
  background: rgba(0,0,0,.55) !important; color: #fff !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.3) !important; text-shadow: none !important;
  display: inline-flex !important; align-items: center; justify-content: center;
  font-family: inherit; font-size: 0 !important; cursor: pointer;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background .15s ease, transform .1s ease;
}
/* El `display` de arriba lleva prefijo de id, así que el atributo `hidden` necesita el mismo peso
   para poder ganarle (ver la nota de .pt-ico[hidden]: pasó de verdad con el botón de compartir). */
#km-panel-container .km-msg-thumbdel[hidden], .km-msg-thumbdel[hidden] { display: none !important; }
.km-msg-thumbdel svg { width: 11px; height: 11px; display: block; }
.km-msg-thumbdel:hover { background: rgba(255,59,48,.92) !important; }
.km-msg-thumbdel:active { transform: scale(.9); }
.km-msg-thumb { transition: box-shadow .15s ease; }
.km-msg-thumb:hover { box-shadow: 0 2px 10px rgba(16,24,40,.14); }
/* Lista de grupos de nivel: alta, con scroll propio, para que no empuje el resto de la columna. */
.km-msg-grps { max-height: 260px; overflow-y: auto; border: 1px solid #eef0f2; border-radius: 12px; padding: 4px; }
.km-msg-grp {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer;
}
.km-msg-grp:hover { background: #f6f8fa; }
.km-msg-grpall { border-bottom: 1px solid #eef0f2; border-radius: 9px 9px 0 0; }
.km-msg-gname { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; font-size: 14px; }
.km-msg-gname > b, .km-msg-gname { overflow: hidden; text-overflow: ellipsis; }
.km-msg-glvl { font-style: normal; font-size: 11px; color: #7a8590; }
.km-msg-gmem { font-size: 12px; color: #7a8590; font-weight: 500; flex: none; }
.km-msg-send { width: 100%; margin-top: 14px; padding: 11px; font-size: 15px; }
/* Cola de envíos programados */
.km-msg-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }
.km-msg-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px;
  background: #f6f8fa; border-radius: 12px; border-left: 3px solid transparent;
}
.km-msg-item.pend { border-left-color: var(--acento, #FF0066); background: #fbfdf2; }
.km-msg-itxt { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.45; word-break: break-word; }
.km-msg-imeta { display: block; font-size: 11.5px; color: #7a8590; margin-top: 3px; }
.km-msg-ipics { font-size: 11.5px; color: #7a8590; white-space: nowrap; }
.km-msg-entry { margin-bottom: 8px; }
.km-msg-toggle { cursor: pointer; }
.km-msg-caret { color: #9aa4ae; font-size: 11px; }
/* ── Ficha de un envío programado ───────────────────────────────────────────────────────────────
   Mismo lenguaje que la ficha de los chats: pastilla de estado, datos en bloques grandes y los
   grupos como fichas. Una lista de clave/valor con 20 nombres pegados no se leía. */
.km-msg-detail { display: none; padding: 14px; margin: 6px 0 0 24px; background: #fff;
  border: 1px solid #e9edf1; border-radius: 14px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.km-msg-entry.open .km-msg-detail { display: block; }
.km-msg-dhead { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.km-msg-dsub { font-size: 12.5px; color: #7a8590; }
.km-msg-pill { font-size: 11.5px; font-weight: 700; padding: 4px 11px; border-radius: 999px; letter-spacing: .01em; }
.km-msg-pill.prog { background: #eef4ff; color: #1d4ed8; }
.km-msg-pill.va   { background: #fff4d6; color: #b45309; }
.km-msg-pill.ok   { background: var(--green-soft, #dcfce7); color: #15803d; }
.km-msg-pill.mal  { background: #fee2e2; color: #b91c1c; }
.km-msg-pill.off  { background: #eef1f4; color: #6b7280; }
/* Progreso del reparto: el único dato que cambia mientras sale. */
.km-msg-prog { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.km-msg-progbar { flex: 1; height: 7px; border-radius: 999px; background: #eef1f4; overflow: hidden; }
.km-msg-progbar i { display: block; height: 100%; border-radius: 999px; background: var(--acento-osc, #C2004D);
  transition: width .4s ease; }
.km-msg-prog span { font-size: 12px; color: #7a8590; font-weight: 600; white-space: nowrap; }
/* Datos: pocos, grandes, con la etiqueta encima. */
.km-msg-gd { display: grid; grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); gap: 1px;
  background: #eef1f4; border: 1px solid #eef1f4; border-radius: 12px; overflow: hidden; }
.km-msg-gd > div { background: #fff; padding: 10px 12px; }
.km-msg-gd span { display: block; font-size: 10px; letter-spacing: .07em; text-transform: uppercase;
  color: #8a94a0; font-weight: 700; margin-bottom: 3px; }
.km-msg-gd b { font-size: 14px; font-weight: 650; color: var(--ink, #0f1115); }
.km-msg-gd b small { font-size: 11.5px; color: #8a94a0; font-weight: 600; }
.km-msg-sec { margin-top: 12px; }
.km-msg-seclab { font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: #8a94a0;
  font-weight: 700; margin-bottom: 7px; }
.km-msg-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.km-msg-chip { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: #f2f5f8; color: #3a4150; }
.km-msg-err { margin-top: 12px; padding: 9px 12px; border-radius: 10px; background: #fee2e2; color: #991b1b; font-size: 12.5px; }
.km-msg-pie { margin-top: 11px; padding-top: 10px; border-top: 1px solid #f0f2f5; font-size: 11.5px; color: #8a94a0; }
.km-msg-cancel { flex: none; font-size: 12px; padding: 5px 10px; color: #b91c1c; }
/* Borrar del historial: mismo tamaño que Cancelar, pero sin el rojo — no para nada, solo quita el
   registro de un envío que ya terminó. El rojo se reserva para lo que sí interrumpe algo. */
.km-msg-del { flex: none; font-size: 12px; padding: 5px 10px; color: var(--ink-soft); }
.km-msg-del:hover:not(:disabled) { color: #b91c1c !important; border-color: #f0c2c2 !important; background: #fff6f6 !important; }
.km-msg-hist { display: flex; justify-content: flex-end; margin: 0 0 8px; }
.km-msg-hist[hidden] { display: none; }
.km-msg-wipe { font-size: 12px; padding: 5px 10px; color: var(--ink-soft); }
@media (max-width: 720px) {
  .km-msg-grps { max-height: 200px; }
  .km-msg-list { max-height: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════════
   TABLA estilo Apple + botones de fila
   ───────────────────────────────────────────────────────────────────────────────────────────────
   Por qué con !important: .km-table ya pedía `border-bottom: none`, pero el tema de WordPress
   pinta `table, th, td { border: 1px solid }` con más especificidad y ganaba — de ahí la rejilla de
   líneas que se veía en Torneos. Aquí se le quita el borde al elemento, no a una esquina, y la
   separación entre filas se hace con fondo alterno y una línea finísima, que es lo que hace una
   tabla legible sin parecer una hoja de cálculo.
   ═══════════════════════════════════════════════════════════════════════════════════════════════ */
.km-table, .km-table thead, .km-table tbody, .km-table tr, .km-table th, .km-table td {
  border: 0 !important; background-image: none !important;
}
.km-table { border-collapse: separate !important; border-spacing: 0 !important; width: 100%; }
.km-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); font-weight: 700; padding: 0 12px 10px !important; white-space: nowrap;
  background: transparent !important;
}
.km-table td {
  padding: 11px 12px !important; font-size: 13.5px; vertical-align: middle; color: var(--ink);
  border-top: 1px solid var(--line-soft) !important;
}
.km-table tbody tr:first-child td { border-top: 0 !important; }
.km-table tbody tr { transition: background .12s ease; }
.km-table tbody tr:hover td { background: #f7f9fb !important; }
.km-table tbody tr:hover td:first-child { border-radius: 12px 0 0 12px; }
.km-table tbody tr:hover td:last-child  { border-radius: 0 12px 12px 0; }
.km-table td b { font-weight: 650; }
.km-table td small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
/* Columnas numéricas: cifras de ancho fijo para que las unidades queden alineadas en vertical. */
.km-table th.num, .km-table td.num { text-align: center; font-variant-numeric: tabular-nums; }
/* Bloque "interés generado": se distingue con un fondo tenue, no con bordes. */
.km-table th.int, .km-table td.int { background: #fbfdf2 !important; }
.km-table tbody tr:hover td.int { background: #f6faea !important; }
.km-td-acts { text-align: right; white-space: nowrap; }

/* Botones pequeños de fila (Ver / Ignorar). Pastilla limpia, sin la caja gruesa del tema. */
.km-rowacts { display: inline-flex; gap: 6px; justify-content: flex-end; }
.km-chip-btn {
  display: inline-flex !important; align-items: center; justify-content: center;
  border: none !important; background: var(--fill) !important; color: var(--ink-soft) !important;
  border-radius: 999px !important; padding: 5px 12px !important; font-size: 12px !important;
  font-weight: 600 !important; line-height: 1 !important; min-height: 0 !important; cursor: pointer;
  font-family: inherit; text-transform: none !important; letter-spacing: 0 !important;
  box-shadow: none !important; text-shadow: none !important; transition: all .14s ease;
  text-decoration: none !important;
}
.km-chip-btn svg { width: 14px; height: 14px; stroke: currentColor; }
.km-chip-btn.ico { padding: 6px 9px !important; }   /* variante solo-icono (p. ej. enlace al Manager) */
.km-chip-btn:hover { background: #f2f5f8 !important; color: var(--ink) !important; border-color: #cdd3da !important; }
.km-chip-btn.primary { border-color: #0f1115 !important; background: #0f1115 !important; color: #fff !important; }
.km-chip-btn.primary:hover { background: #23272e !important; border-color: #23272e !important; color: #fff !important; }

/* Ficha del pozo: pie de acciones y filas del resumen */
.km-tor-acts { display: flex; gap: 9px; margin-top: 18px; flex-wrap: wrap; }
.km-tor-acts a { text-decoration: none !important; }
.km-btn-primary svg.km-navlogo, .km-btn-primary svg.km-navlogo path { stroke: none !important; fill: currentColor !important; }
.km-tor-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 10px 0; font-size: 13.5px; border-top: 1px solid var(--line-soft);
}
.km-tor-row:first-child { border-top: 0; }
.km-tor-row > span { color: var(--muted); }
.km-tor-row > b { font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }

/* Aviso de envíos bloqueados / con tope (lo decide el bot, el panel solo lo refleja) */
.km-wa-blocked {
  display: flex; flex-direction: column; gap: 3px; padding: 12px 15px; border-radius: 12px;
  margin-bottom: 16px; font-size: 13px; line-height: 1.5;
}
.km-wa-blocked b { font-weight: 700; }
.km-wa-blocked span { color: var(--muted); font-size: 12.5px; }
.km-wa-blocked.off { background: #fff5f5; border: 1px solid #fbcaca; color: #b91c1c; }
.km-wa-blocked.lim { background: #fbfdf2; border: 1px solid #e9f0cf; color: var(--ink-soft); }

@media (max-width: 760px) {
  .km-table th, .km-table td { white-space: nowrap; }
  .km-tor-acts .km-btn-primary, .km-tor-acts .km-btn-ghost { flex: 1 1 auto; }
}

/* Hilo de "Compartir partido": separar lo de ANTES de lo de AHORA. Sin esto, el resultado de un
   envío anterior del día (con sus reenvíos) se lee como si fuera la respuesta al enlace que acabas
   de pegar — que es justo lo que confundía. */
.km-ia-sep {
  display: flex; align-items: center; gap: 10px; margin: 6px 0 2px;
  font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 700;
}
.km-ia-sep::before, .km-ia-sep::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); }
.km-ia-bub.hist { opacity: .72; }
.km-ia-hora {
  display: inline-block; margin-right: 7px; padding: 1px 7px; border-radius: 999px;
  background: rgba(15,17,21,.06); color: var(--muted); font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ── Torneos: filtros de periodo, franja elegida y paginación ──────────────────────────────────
   El periodo manda sobre TODO lo que hay debajo (KPIs, bloques, mapa y tabla): mirar el mapa de 90
   días junto a una tabla de 365 no responde a ninguna pregunta. */
.km-tor-filtros { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 14px; }
.km-tor-rango { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; width: 100%; margin-top: 4px; }
.km-tor-rango[hidden] { display: none; }
.km-tor-rango > span { color: var(--muted); font-size: 12.5px; }
.km-tor-rango input[type=date] {
  width: auto !important; padding: 6px 10px !important; font-size: 13px !important;
}
.km-tor-filtro-act {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fbfdf2; border: 1px solid #e9f0cf; border-radius: 12px;
  padding: 9px 13px; margin-bottom: 14px; font-size: 13px; color: var(--ink-soft);
}

/* Celdas del mapa de franjas: ahora son botones (filtran la tabla de abajo). */
.km-torheat {
  height: 30px; border: 0 !important; border-radius: 7px !important; padding: 0 !important;
  display: grid; place-items: center; font-family: inherit; font-size: 11px !important;
  /* ⚠️ #121212 y no el #262b34 de antes. Sobre el escalón del 75 % (#FF0066) aquel gris azulado se
     quedaba en 3,68:1 — por debajo del 4,5 que pide el texto, y encima PEOR que el blanco (3,86),
     así que fallaba de las dos maneras y ningún «ponlo en blanco» lo habría arreglado. Con la tinta
     del panel sube a 4,86. Los escalones más claros ganan de sobra. */
  font-weight: 700 !important; color: #121212 !important; cursor: pointer; min-height: 0 !important;
  box-shadow: none !important; text-shadow: none !important; line-height: 1 !important;
  transition: transform .12s ease, box-shadow .12s ease;
}
.km-torheat:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(16,24,40,.16); }
.km-torheat.activa { box-shadow: 0 0 0 2px #0f1115 inset; }
.km-torheat.vacia { background: #f4f6f8 !important; cursor: default; pointer-events: none; }
/* ⚠️ EL ESCALÓN MÁS OSCURO, EN BLANCO. Sobre #8E0040 la tinta oscura da 2,0:1 — ilegible, y es
   justo la celda que más mira el club porque es la del «se llena siempre». En blanco son 9,44:1.
   No se le pone blanco a los demás escalones: sobre #FF0066 el blanco baja a 3,86 y la tinta
   oscura está en 4,9, así que ahí el blanco sería un paso atrás. Una celda, una medida. */
.km-torheat.blanca { color: #fff !important; }

.km-pag-info { text-align: center; margin-top: 14px; font-size: 12.5px; color: var(--muted); }

/* ───────────────────────────── NOA (asistente) ─────────────────────────────
   Formato de chat desde el principio: el día que se le conecte una IA de verdad no hay que
   rehacer la pantalla, solo cambiar de dónde sale la respuesta. */
#km-panel-container .noa-wrap { max-width: 820px; margin: 0 auto; }
#km-panel-container .noa-hero { padding: 22px 0 0; }
#km-panel-container .noa-greet { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 700; color: var(--ink); }
/* La marca del saludo: el perro robot sobre un disco de acento. El disco NO es adorno — en plano,
   el acento sobre fondo claro se queda corto de contraste; al punto macizo que había antes le daba
   igual, pero un dibujo con detalle se desvanece. Así se conserva el acento Y se ve el perro. */
/* El perro va en BLANCO. Medido: blanco sobre el acento da 3,86:1 y la tinta oscura 4,65:1 — para
   TEXTO ganaría la oscura, pero esto es un dibujo, y a un gráfico la norma le pide 3:1, que el
   blanco pasa de sobra. Y en blanco se lee como una marca y no como una mancha. */
#km-panel-container .noa-marca { width: 22px; height: 22px; flex: none; display: inline-flex;
  background: var(--acento); border-radius: 50%; padding: 2.5px; box-sizing: border-box; color: #fff; }
#km-panel-container .noa-marca svg { width: 100%; height: 100%; }
/* BETA junto al saludo: Noa da consejos sobre dinero y calendario, así que conviene que se vea
   que todavía está aprendiendo antes de que alguien cambie su programación por lo que diga. */
/* ⚠️ BETA SÍ ES TEXTO, y de 10 px: aquí el blanco sobre el acento da 3,86:1 y se queda corto (hace
   falta 4,5). Poniéndolo en blanco a secas se vería PEOR, no mejor. La forma de tenerlo blanco de
   verdad es bajar el fondo al acento oscuro: blanco sobre #C2004D son 6,17:1, que pasa con holgura.
   Es la misma regla que ya se aplicó al botón de entrar — el acento claro no aguanta texto blanco
   pequeño, y no es cuestión de gusto sino de medida. */
#km-panel-container .noa-beta { margin-left: 8px; padding: 2px 7px; border-radius: 999px;
  background: var(--acento-osc); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .6px;
  vertical-align: middle; }
#km-panel-container .noa-h1 { font-size: 34px; font-weight: 700; letter-spacing: -.8px; margin: 8px 0 18px; }
/* Alarmas: lo primero que se ve al abrir Noa, con su × para no volver a verlo.
   Van ANTES del saludo a propósito — un aviso debajo del pliegue no es un aviso. */
#km-panel-container .noa-alarmas { display: grid; gap: 10px; margin: 0 0 20px; }
#km-panel-container .noa-alarma { position: relative; border-radius: 14px; padding: 14px 40px 14px 16px;
  border: 1px solid; }
#km-panel-container .noa-alarma.alta { background: #fff7ed; border-color: #fed7aa; }
#km-panel-container .noa-alarma.media { background: #f8fafc; border-color: var(--line); }
#km-panel-container .noa-alarma-tit { font-weight: 700; font-size: 14.5px; color: var(--ink); }
#km-panel-container .noa-alarma-txt { margin-top: 4px; font-size: 13.5px; line-height: 1.5; color: #4b5563; }
#km-panel-container .noa-alarma .noa-acts { margin: 10px 0 0; }
/* "Y N avisos más": es un <button> y sin esto el tema de WordPress lo pinta con su acento y texto blanco,
   o sea ilegible. Mismo problema que la × y que los chips: ver el bloque de blindaje del final. */
#km-panel-container .noa-alarma-mas { display: block; width: 100%; margin: 2px 0 0; padding: 11px 14px;
  border: 1px dashed var(--line); border-radius: 12px; background: none; cursor: pointer;
  font: 600 13px/1.3 inherit; color: var(--muted); text-align: center; }
#km-panel-container .noa-alarma-mas:hover { background: #f8fafc; color: var(--ink); border-color: #cbd5e1; }
#km-panel-container .noa-alarma-x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px;
  border: 0; background: none; border-radius: 8px; cursor: pointer; font-size: 19px; line-height: 1;
  color: var(--muted); }
#km-panel-container .noa-alarma-x:hover { background: rgba(0,0,0,.06); color: var(--ink); }

/* Lo que Noa no supo responder, al final de Avisos. Deliberadamente apagado: es nuestra lista de
   deberes, no un aviso para el club, y no puede competir visualmente con un partido que se cae hoy. */
#km-panel-container .noa-dudas { margin: 24px 0 0; padding: 16px; border: 1px dashed var(--line);
  border-radius: 14px; background: #fcfcfd; }
#km-panel-container .noa-dudas-tit { font-weight: 700; font-size: 13.5px; color: var(--muted); }
/* "Solo Kortmind": la chapa que deja claro que esa caja no la ve el club. Va en rosa de marca y
   no en gris como el resto del bloque, porque es lo unico de esta pantalla que cambia segun quien
   mire y conviene que salte a la vista. */
#km-panel-container .noa-dudas-solo { display: inline-block; margin-left: 8px; vertical-align: middle;
  font: 700 10px/1 inherit; letter-spacing: .04em; text-transform: uppercase; color: #FF0066;
  background: rgba(255,0,102,.1); border: 1px solid rgba(255,0,102,.25); border-radius: 999px;
  padding: 4px 8px; }
#km-panel-container .noa-dudas-sub { margin-top: 4px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
#km-panel-container .noa-dudas-lista { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
#km-panel-container .noa-dudas-lista li { display: flex; align-items: baseline; gap: 10px;
  padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
/* La pregunta es texto del gerente: se parte en vez de desbordar la caja (puede venir sin espacios). */
#km-panel-container .noa-dudas-txt { flex: 1; font-size: 13px; line-height: 1.45; color: #4b5563;
  overflow-wrap: anywhere; }
#km-panel-container .noa-dudas-veces { flex: none; font: 600 11.5px/1 inherit; color: var(--muted);
  background: #f1f5f9; border-radius: 999px; padding: 5px 9px; white-space: nowrap; }

/* "Esto es lo que puedo hacer", en el estado inicial. Va antes de la caja de pregunta porque lo
   primero que hace falta saber es el alcance: qué tiene sentido preguntarle y qué no. La tira de
   sugerencias se mueve, y esperar a que pase la que interesa no es forma de descubrir una función. */
#km-panel-container .noa-puedo { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 9px; }
#km-panel-container .noa-puedo li { position: relative; padding-left: 20px; font-size: 14.5px;
  line-height: 1.5; color: var(--ink); }
#km-panel-container .noa-puedo li::before { content: ''; position: absolute; left: 2px; top: 8px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--acento); }
#km-panel-container .noa-puedo-no { margin: 0 0 22px; font-size: 12.5px; color: var(--muted); }

/* Caja de pregunta */
#km-panel-container .noa-box { background: var(--card); border: none; border-radius: var(--radius); padding: 20px 22px 14px;
  box-shadow: var(--shadow); }
#km-panel-container .noa-input { width: 100%; border: 0; outline: 0; background: none; font-family: inherit; font-size: 15.5px;
  color: var(--ink); padding: 2px 0 12px; }
#km-panel-container .noa-input::placeholder { color: var(--muted); }
#km-panel-container .noa-box-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#km-panel-container .noa-hint { font-size: 12px; color: var(--muted); }
#km-panel-container .noa-send { width: 38px; height: 38px; border: 0; border-radius: 11px; background: var(--acento); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
#km-panel-container .noa-send svg { width: 18px; height: 18px; }
#km-panel-container .noa-send:hover { filter: brightness(1.05); }

/* Tira de sugerencias que se mueve sola. Se para al pasar el ratón para poder pulsarlas. */
#km-panel-container .noa-chips { overflow: hidden; margin: 18px 0 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
#km-panel-container .noa-chips-track { display: flex; gap: 9px; width: max-content; animation: noa-marquee 34s linear infinite; }
#km-panel-container .noa-chips:hover .noa-chips-track { animation-play-state: paused; }
@keyframes noa-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
#km-panel-container .noa-chip { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; cursor: pointer;
  background: var(--fill); border: none; border-radius: var(--pill); padding: 9px 16px;
  font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
#km-panel-container .noa-chip:hover { border-color: var(--acento-osc); color: var(--ink); }
@media (prefers-reduced-motion: reduce) { #km-panel-container .noa-chips-track { animation: none; } #km-panel-container .noa-chips { overflow-x: auto; } }

/* Conversación */
#km-panel-container .noa-chat { max-height: 56vh; overflow-y: auto; padding: 10px 4px 26px; display: flex;
  flex-direction: column; gap: 22px; margin-bottom: 20px; }
#km-panel-container .noa-row { display: flex; align-items: flex-start; gap: 11px; }
#km-panel-container .noa-row.user { justify-content: flex-end; }
#km-panel-container .noa-ava { width: 34px; height: 34px; border-radius: 50%; flex: none; background: #f2f4f7 url('noa.png') center/cover no-repeat;
  border: 1px solid var(--line); }
#km-panel-container .noa-bub { background: var(--fill); border: none; border-radius: var(--radius-sm); padding: 16px 19px;
  font-size: 14px; line-height: 1.6; color: var(--ink-soft); max-width: 86%; }
#km-panel-container .noa-bub b { color: var(--ink); }
#km-panel-container .noa-bub.user { background: #15171c; color: #fff; border-color: #15171c; font-weight: 600; }
#km-panel-container .noa-list { margin: 9px 0 0; padding-left: 18px; }
#km-panel-container .noa-list li { margin-bottom: 5px; }
#km-panel-container .noa-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
/* Variante EN LÍNEA. `.noa-mini` es display:block, así que un "(2 de 2)" dentro de una fila de
   lista rompía el renglón y cada dato caía en su propia línea: la tabla se leía como una lista
   suelta de trozos. Esta no rompe nada. */
#km-panel-container .noa-min { font-size: 12px; color: var(--muted); }
#km-panel-container .noa-mini { display: block; margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.5; }
#km-panel-container .noa-foot { font-size: 12px; color: var(--muted); text-align: center; margin: 18px 0 8px; }

@media (max-width: 640px) { #km-panel-container .noa-h1 { font-size: 26px; } #km-panel-container .noa-bub { max-width: 100%; } }

/* Blindaje de Noa contra el tema de WordPress. Mismo motivo que el bloque de más arriba: el tema
   estila <button> con !important, y por eso las sugerencias y el botón de enviar salían con el acento del tema y
   la flecha no se veía. Con !important ganan estos, que son los del panel. */
.noa-chip { background: var(--card) !important; color: var(--ink-soft) !important;
  border: none !important; border-radius: 999px !important;
  text-transform: none !important; letter-spacing: normal !important; box-shadow: none !important;
  font-weight: 600 !important; padding: 9px 16px !important; }
.noa-chip:hover { background: #fff !important; color: var(--ink) !important; border-color: var(--acento-osc) !important; }
.noa-send { background: var(--acento) !important; color: #fff !important; border: 0 !important;
  border-radius: 11px !important; box-shadow: none !important; padding: 0 !important; }
.noa-send svg { stroke: #fff !important; fill: none !important; }
.noa-input { background: none !important; border: 0 !important; box-shadow: none !important;
  color: var(--ink) !important; padding: 2px 0 12px !important; }
.noa-bub.user { background: #15171c !important; color: #fff !important; border-color: #15171c !important; }
.noa-ava { border-radius: 50% !important; }
/* El disco de acento de la marca: sin esto, un tema que estilice el fondo de los <span> en línea se
   lo come y el perro queda en #15171c sobre fondo claro, que no es lo que se quiere ver. */
.noa-marca { background: var(--acento) !important; border-radius: 50% !important; color: #fff !important; }
/* La × de las alarmas es un <button>: sin esto el tema la pinta con su acento y fondo y ocupa media tarjeta. */
.noa-beta { background: var(--acento-osc) !important; color: #fff !important; }
.noa-alarma-mas { background: none !important; color: #6b7280 !important; border: 1px dashed #e5e7eb !important;
  box-shadow: none !important; text-transform: none !important; letter-spacing: normal !important; }
.noa-alarma-mas:hover { background: #f8fafc !important; color: #15171c !important; }
.noa-alarma-x { background: none !important; border: 0 !important; box-shadow: none !important;
  color: #6b7280 !important; padding: 0 !important; min-width: 0 !important; }
.noa-alarma-x:hover { background: rgba(0,0,0,.06) !important; color: #15171c !important; }
.noa-marca svg { fill: currentColor !important; stroke: none !important; }

/* ============================================================================
   MATCH BOOST
   Parrilla del club, partidos en marcha y condición de salida. Todo sale del
   documento que empuja el bot: esta pantalla NO consulta a Playtomic.
   ========================================================================== */
/* Clases nuevas de la sección Match Boost (irían a panel.css). Usan los tokens del sistema. */
.mb-grid { display: grid; grid-template-columns: 96px repeat(5, 1fr); gap: 6px; }
.mb-head  { font-size: 11.5px; font-weight: 700; color: var(--muted); text-align: center; padding: 2px 0 6px; letter-spacing: .04em; }
.mb-court { font-size: 13px; font-weight: 600; display: flex; align-items: center; color: var(--ink-soft); }
.mb-cell  { height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
            font-size: 12px; font-weight: 600; }
.mb-cell.ocupada { background: #ebebe8; color: #8e8e89; }
/* El hueco libre va en violeta, no en gris: es el ÚNICO sitio donde se puede pulsar, y un gris
   apagado al lado del gris de «reservada» no lo dice. El tono sale de --violet, que ya está en la
   paleta del panel, así que no entra un color nuevo al sistema. */
.mb-cell.libre   { background: #f3f0ff; color: #6d5bd0; box-shadow: inset 0 0 0 1.5px #ddd6ff; }
.mb-cell.libre::after { content: '+'; margin-left: 7px; font-weight: 700; color: #a99ae8; }
.mb-cell.cebo    { background: #ffe3ef; color: #C2004D; box-shadow: inset 0 0 0 1.5px #ffc2d9; }
.mb-cell.cebo.lleno { background: var(--acento); color: #fff; box-shadow: none; }
.mb-leyenda { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 16px; font-size: 12px; color: var(--muted); }
.mb-leyenda span { display: inline-flex; align-items: center; gap: 7px; }
.mb-sw { width: 13px; height: 13px; border-radius: 5px; display: inline-block; }
.mb-sw.ocupada { background: #ebebe8; } .mb-sw.libre { background: #f3f0ff; box-shadow: inset 0 0 0 1.5px #ddd6ff; }
.mb-sw.cebo { background: #ffe3ef; box-shadow: inset 0 0 0 1.5px #ffc2d9; }

.mb-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--fill);
          border-radius: 16px; margin-bottom: 10px; }
.mb-row.apagada { opacity: .55; }
.mb-row-main { flex: 1; min-width: 0; }
.mb-row-top  { font-size: 14px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
/* La pista y la hora no se parten nunca: con dos etiquetas al lado, «Pista 3 · 20:30» caía en
   dos líneas y la fila dejaba de leerse de un vistazo, que es justo para lo que está. */
.mb-row-top b { white-space: nowrap; }
.mb-row-top .km-tag { white-space: nowrap; }
.mb-row-sub  { font-size: 12px; color: var(--muted); margin-top: 3px; }
/* Ancho fijo: si no, la fila con la etiqueta más larga («Saliendo en 4 min») le roba sitio al
   título y lo parte en dos líneas, y esa fila queda más alta que las demás. */
.mb-row-state { text-align: right; flex: none; width: 150px; }
.mb-row-note  { font-size: 11px; color: var(--muted); margin-top: 4px; }
/* Las plazas, en puntos en vez de en texto: de un vistazo se ve a cuál le falta uno. */
.mb-players { display: flex; align-items: center; gap: 5px; flex: none; }
.mb-players i { width: 10px; height: 10px; border-radius: 50%; background: #dcdcd7; display: block; }
.mb-players i.on { background: var(--acento); }
.mb-players span { font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-left: 5px; }

.mb-ajuste { margin-bottom: 20px; }
.mb-ajuste-lbl  { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 8px; }
.mb-ajuste-nota { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin-top: 8px; }
.mb-ajuste .km-segment { display: flex; }
.mb-ajuste .km-segment button { flex: 1; }

/* Modal de creación */
.mb-back { position: fixed; inset: 0; background: rgba(18,18,18,.35); display: flex; align-items: center; justify-content: center; }
.mb-modal { background: #fff; border-radius: 28px; width: 620px; max-width: calc(100vw - 40px); overflow: hidden; }
.mb-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 26px 18px; }
.mb-modal-body { padding: 0 26px 6px; }
.mb-modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px;
                 padding: 18px 26px 24px; margin-top: 18px; border-top: 1px solid var(--line-soft); }
.mb-f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.mb-opt { display: flex; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--fill);
          margin-bottom: 10px; cursor: pointer; align-items: flex-start; }
.mb-opt.sel { background: #ffe3ef; box-shadow: inset 0 0 0 2px var(--acento); }
.mb-opt input { margin-top: 3px; accent-color: var(--acento); }
.mb-opt-sub { font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 3px; }
/* El aviso de que esto es asíncrono NO es un detalle de implementación que se pueda esconder:
   el panel vive en la web y el bot en el PC del club. Si la pantalla finge que crea ella, el
   club da por hecho que ha fallado cuando no aparece al instante. */
.mb-aviso { background: var(--info-bg, #e8ecf2); color: #41566e; border-radius: 16px; padding: 14px 16px;
            font-size: 12.5px; line-height: 1.55; margin: 18px 0 16px; }
.mb-pasos { display: flex; gap: 10px; }
.mb-paso { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.mb-paso i { width: 9px; height: 9px; border-radius: 50%; background: #dcdcd7; flex: none; }
.mb-paso.ok  i { background: #22c55e; } .mb-paso.ok  { color: var(--ink-soft); }
.mb-paso.act i { background: var(--acento); box-shadow: 0 0 0 4px rgba(255,0,102,.16); }
.mb-paso.act { color: var(--ink); font-weight: 600; }

/* De dónde salió cada partido. Con dos orígenes (el reloj del bot y el club a mano) hace falta
   distinguirlos: el cupo del panel solo cuenta los de «lo creaste tú». */
.mb-origen { color: var(--ink-soft); font-weight: 700; }
.mb-origen.tuyo { color: var(--acento-osc); }

/* Las dos tarjetas de abajo, a la misma altura.
   No estaban desiguales por el contenido: `.km-card:last-child` quita el margen inferior, y como
   la de la derecha es la última del grid, su caja estiraba 18 px más que la de la izquierda —
   justo ese margen. Se anula en las dos y el grid ya las iguala solo. */
.mb-par { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; align-items: stretch; }
.mb-par > .km-card { margin-bottom: 0; display: flex; flex-direction: column; }
/* El botón se va al fondo: con las tarjetas igualadas, dejarlo pegado al último ajuste deja un
   hueco raro debajo. */
.mb-par > .km-card > .km-btn:last-child { margin-top: auto; }

.mb-manual { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.mb-check { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-soft); }
.mb-check input { accent-color: var(--acento); }
/* El aviso va DENTRO de la opción, no en una nota al pie: si el club no lo lee, el que se lleva
   el disgusto es una persona de verdad a la que han apuntado y desapuntado sin avisar. */
.mb-ojo { background: var(--warn-bg, #fdeacf); color: #8d5b0b; border-radius: 12px; padding: 10px 12px;
          font-size: 12px; line-height: 1.5; margin-top: 12px; }
.mb-vacio { padding: 26px 0; text-align: center; color: var(--muted); font-size: 13.5px; }

/* Blindaje: las celdas libres son <button> (hay que poder pulsarlas con el teclado) y el tema de
   WordPress estiliza TODOS los <button> — borde, sombra y a veces su propio color. Sin esto la
   parrilla sale con un recuadro negro por celda. Mismo problema que el resto de blindajes de este
   fichero; ver la cabecera de la sección. */
#km-panel-container .mb-cell,
.mb-cell { border: none !important; box-shadow: none; font-family: inherit; }
#km-panel-container .mb-cell.libre,
.mb-cell.libre { background: #f3f0ff !important; color: #6d5bd0 !important;
  box-shadow: inset 0 0 0 1.5px #ddd6ff !important; cursor: pointer; }
#km-panel-container .mb-cell.libre:hover,
.mb-cell.libre:hover { background: #e9e4ff !important; }
#km-panel-container .mb-cell.ocupada, .mb-cell.ocupada { background: #ebebe8 !important; color: #8e8e89 !important; }
#km-panel-container .mb-cell.cebo,    .mb-cell.cebo    { background: #ffe3ef !important; color: #C2004D !important;
  box-shadow: inset 0 0 0 1.5px #ffc2d9 !important; }
#km-panel-container .mb-cell.cebo.lleno, .mb-cell.cebo.lleno { background: var(--acento) !important; color: #fff !important; box-shadow: none !important; }

/* Hueco libre en Playtomic pero sin margen para crear: se enseña (es información) y no se pulsa.
   Playtomic cancela solo un partido abierto 1 h antes si no se ha llenado, así que ofrecerlo a dos
   horas vista sería ofrecer un partido que se cae. */
#km-panel-container .mb-cell.tarde, .mb-cell.tarde {
  background: #f6f6f4 !important; color: #c3c3bd !important;
  box-shadow: inset 0 0 0 1.5px #ededea !important; cursor: default; font-weight: 500; }
.mb-court.tarde { color: #c3c3bd; }
.mb-sw.tarde { background: #f6f6f4; box-shadow: inset 0 0 0 1.5px #ededea; }
/* Con las pistas arriba, la primera columna son horas: más estrecha y alineada a la derecha para
   que los números queden en columna y se lean de un golpe. */
.mb-grid .mb-court { justify-content: flex-end; padding-right: 10px; font-variant-numeric: tabular-nums; }

/* ═══════════════════════════════════  RADAR  ═══════════════════════════════════
   Qué hacen los clubes de la zona. Deliberadamente sobrio: es una pantalla para leer números y
   decidir, no para impresionar. El magenta se reserva para lo que de verdad hay que mirar (un
   choque, un formato que les funciona y no has probado). */
#km-panel-container .rd-sub { margin: 6px 0 16px; font-size: 13px; line-height: 1.6; color: var(--muted); max-width: 90ch; }
#km-panel-container .rd-sep { height: 1px; background: var(--line); margin: 18px 0 14px; }

/* Lectura corta y legible: el texto que acompaña a un número no compite con él. */
#km-panel-container .rd-pill { display: inline-block; padding: 5px 10px; border-radius: 8px;
  background: #FFF0F5; color: #C2004D; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
#km-panel-container .rd-pill.mal { background: #FFF7ED; color: #B45309; white-space: normal; }

/* Un choque. El de nivel que no se toca se ve más apagado, porque pesa menos — pero se ve: sigue
   compitiendo por la tarde aunque no por los mismos jugadores. */
#km-panel-container .rd-choque { display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  padding: 15px 16px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
#km-panel-container .rd-choque.flojo { background: #FCFCFD; }
#km-panel-container .rd-choque-txt { flex: 999 1 320px; min-width: 0; font-size: 14px; line-height: 1.45; }
#km-panel-container .rd-choque-vs { margin-top: 5px; font-size: 13.5px; color: #4b5563; }
#km-panel-container .rd-choque-num { margin-top: 5px; font-size: 12.5px; color: var(--muted); }
#km-panel-container .rd-choque-num i { color: var(--muted); }
/* Los dos botones juntos y a la derecha. `flex: none` para que no se estiren con la fila, y
   `flex-wrap` para que en una ventana estrecha caigan uno debajo del otro en vez de salirse. */
#km-panel-container .rd-choque-acc { display: flex; flex-wrap: wrap; gap: 8px; flex: none; }

/* ─────────────────────────  RADAR: IDEAS, FICHA, MAPA Y BARRAS  ─────────────────────────
   Los dos colores de serie, declarados una vez. No son decorativos: el par está COMPROBADO con el
   validador de daltonismo contra el fondo claro (ΔE 17,7 en protanopia, 36,2 en visión normal), y
   cambiar cualquiera de los dos a ojo puede dejar las dos series indistinguibles para quien no ve
   bien el rojo. Si hay que tocarlos, se vuelve a pasar el validador. Además cada barra lleva su
   número escrito y su etiqueta al lado, así que el color ayuda pero no es de lo que depende leerlo. */
/* ⚠️ En `:root`, NO en `#km-panel-container`. El modal de la ficha se cuelga de `document.body`
   (ver `ponModal`), o sea FUERA del contenedor del panel: declaradas ahí dentro, las barras del
   modal se quedaban sin color. */
:root { --rd-ellos: #2a78d6; --rd-tu: #FF0066; }

/* La barra de «x de y». Fina a propósito: es un apoyo para comparar de un vistazo, no el
   protagonista — el número va siempre escrito. */
.rd-bar { display: block; height: 8px; border-radius: 4px; background: var(--fill, #eceae7); overflow: hidden; }
.rd-bar-fill { display: block; height: 100%; border-radius: 4px; }
.rd-bar-g { flex: 1 1 auto; min-width: 0; }

/* Una idea es una FILA-BOTÓN, no una celda de tabla: se pulsa entera y abre su ficha. */
#km-panel-container .rd-ideas-cab,
#km-panel-container .rd-idea {
  display: grid; grid-template-columns: minmax(0, 1fr) 190px 128px 150px; gap: 16px; align-items: center;
}
#km-panel-container .rd-ideas-cab {
  padding: 0 8px 9px; font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--line);
}
#km-panel-container .rd-idea {
  width: 100%; padding: 14px 8px; border: 0; border-bottom: 1px solid var(--line); background: none;
  font-family: inherit; text-align: left; cursor: pointer; color: var(--ink);
}
#km-panel-container .rd-idea:last-child { border-bottom: 0; }
#km-panel-container .rd-idea:hover { background: var(--fill, #f7f6f4); }
#km-panel-container .rd-idea-col { min-width: 0; display: block; }
#km-panel-container .rd-idea-nom { display: block; font-size: 15px; font-weight: 700; line-height: 1.3; }
/* El precio, el nivel y los eventos se leen como una FRASE. En columnas eran cuatro números sueltos
   que había que cruzar con su cabecera para saber qué era cada uno. */
#km-panel-container .rd-idea-sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
#km-panel-container .rd-idea-clubes { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
#km-panel-container .rd-idea-num { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 5px; }
#km-panel-container .rd-idea-dias { font-size: 13.5px; }
#km-panel-container .rd-idea-flojo { font-size: 12.5px; color: var(--muted); }

/* La ficha. */
.rd-ficha-sub { margin: 0 0 4px; font-size: 13.5px; color: var(--muted); }
.rd-ficha-real { margin: 0 0 16px; font-size: 12.5px; color: var(--muted); }
.rd-ficha-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rd-ficha-num { background: var(--card); padding: 13px 15px; }
.rd-ficha-rot { font-size: 10.5px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.rd-ficha-val { font-size: 21px; font-weight: 700; line-height: 1.1; }
.rd-ficha-de { font-size: 13px; font-weight: 400; color: var(--muted); }
.rd-ficha-pie { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.rd-ficha-h { margin: 22px 0 10px; font-size: 14.5px; font-weight: 700; }
.rd-ficha-cab,
.rd-ficha-fila {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) 130px 168px 84px; gap: 12px; align-items: center;
}
.rd-ficha-cab { padding: 0 2px 8px; font-size: 10.5px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.rd-ficha-fila { padding: 11px 2px; border-bottom: 1px solid var(--fill, #f3f1ee); font-size: 13.5px; }
.rd-ficha-fila:last-child { border-bottom: 0; }
/* Un nombre largo recorta; no envuelve: con dos líneas, la fila deja de leerse como una fila. */
.rd-ficha-nom { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-ficha-club { color: var(--muted); }
.rd-ficha-lleno { display: flex; align-items: center; gap: 9px; }
.rd-ficha-lleno .rd-bar { flex: none; width: 84px; }
.rd-ficha-xy { font-size: 12.5px; white-space: nowrap; }
.rd-ficha-nota { margin: 16px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); }

/* El mapa de la semana. */
#km-panel-container .rd-mapa { display: grid; gap: 4px; align-items: center; margin-top: 4px; }
#km-panel-container .rd-mapa-h { font-size: 10.5px; font-weight: 600; color: var(--muted); text-align: center; }
#km-panel-container .rd-mapa-d { font-size: 12.5px; font-weight: 600; }
#km-panel-container .rd-mapa-c { height: 42px; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; font-size: 13.5px; font-weight: 600; color: var(--ink); }
/* «Tú también programas aquí» con un RECUADRO y no con otro color: el color ya está diciendo
   cuántos eventos hay, y dos codificaciones de color en la misma celda no se pueden separar. */
#km-panel-container .rd-mapa-mio { outline: 2px solid var(--ink); outline-offset: -2px; }

#km-panel-container .rd-leyenda { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 16px; }
#km-panel-container .rd-leyenda-g { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
#km-panel-container .rd-leyenda-s { width: 20px; height: 13px; border-radius: 3px; display: inline-block; }

/* Las barras enfrentadas de Horarios. */
#km-panel-container .rd-franja { padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); }
#km-panel-container .rd-franja:first-of-type { border-top: 0; margin-top: 8px; }
#km-panel-container .rd-franja-cab { display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; flex-wrap: wrap; margin-bottom: 9px; font-size: 15px; }
#km-panel-container .rd-franja-mal { font-size: 13px; font-weight: 600; color: #C2004D; }
#km-panel-container .rd-franja-bien { font-size: 13px; font-weight: 600; color: #1b6b45; }
#km-panel-container .rd-franja-b { display: grid; grid-template-columns: 128px minmax(0, 1fr) 72px;
  gap: 12px; align-items: center; font-size: 13.5px; margin-top: 5px; }
#km-panel-container .rd-bsl { color: var(--muted); min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
#km-panel-container .rd-bsv { font-size: 13.5px; }
#km-panel-container .rd-franja-pie { margin-top: 9px; font-size: 12.5px; color: var(--muted); }

/* En una ventana estrecha las rejillas de cuatro y cinco columnas no caben: pasan a lista. */
@media (max-width: 900px) {
  #km-panel-container .rd-ideas-cab { display: none; }
  #km-panel-container .rd-idea,
  .rd-ficha-fila { grid-template-columns: 1fr; gap: 7px; }
  .rd-ficha-cab { display: none; }
  .rd-ficha-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #km-panel-container .rd-franja-b { grid-template-columns: 92px minmax(0, 1fr) 62px; }
  #km-panel-container .rd-mapa-c { height: 34px; font-size: 12px; }
}

/* ── EL CHOQUE, COMO FICHA ────────────────────────────────────────────────────────────────
   Antes era una línea de texto corrido en la que había que reconstruir mentalmente qué chocaba con
   qué. Enfrentados se ve de un golpe: la fecha arriba con la diferencia de horas, tu pozo y el suyo
   uno al lado del otro, y los botones debajo. El filete magenta de la izquierda es lo que distingue
   un choque de verdad de una coincidencia floja sin tener que leerla. */
#km-panel-container .rd-ch-card {
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--acento);
  border-radius: 16px; padding: 17px 19px; margin-bottom: 12px;
}
/* La coincidencia de otro nivel no se esconde, se apaga: compiten por la pista pero no por los
   mismos jugadores, así que no puede llamar igual que un choque real. */
#km-panel-container .rd-ch-card.flojo { border-left-color: var(--line); background: #FCFCFB; }
#km-panel-container .rd-ch-cab { font-size: 12.5px; font-weight: 600; color: var(--acento-osc); margin-bottom: 12px; }
#km-panel-container .rd-ch-card.flojo .rd-ch-cab { color: var(--muted); }
#km-panel-container .rd-ch-vs { display: flex; gap: 12px; flex-wrap: wrap; align-items: stretch; }
#km-panel-container .rd-ch-lado {
  flex: 1 1 260px; min-width: 0; background: var(--fill); border-radius: 12px; padding: 12px 14px;
}
#km-panel-container .rd-ch-rot {
  font-size: 11px; font-weight: 600; letter-spacing: 1.1px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 5px;
}
#km-panel-container .rd-ch-nom { font-size: 15px; font-weight: 700; line-height: 1.3; margin-bottom: 4px; }
#km-panel-container .rd-ch-dat { font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); }
#km-panel-container .rd-ch-pie {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-top: 12px;
}
#km-panel-container .rd-ch-nota { font-size: 12.5px; line-height: 1.5; color: var(--muted); flex: 1 1 260px; min-width: 0; }
#km-panel-container .rd-ch-acc { display: flex; flex-wrap: wrap; gap: 8px; flex: none; }
/* El estado vacío: con su marca de visto, para que se lea como una buena noticia y no como un
   hueco donde no ha cargado nada. */
#km-panel-container .rd-ch-vacio { display: flex; gap: 12px; align-items: flex-start; padding: 4px 0 2px; }
#km-panel-container .rd-ch-vacio svg { flex: none; margin-top: 1px; }
#km-panel-container .rd-ch-vacio-tit { font-size: 14.5px; font-weight: 600; margin-bottom: 3px; }
#km-panel-container .rd-ch-vacio-sub { font-size: 13px; line-height: 1.55; color: var(--muted); }

/* «Casi todo de un mismo club»: la advertencia va PEGADA al formato del que habla, no al pie de la
   tabla, porque es lo que decide si ese número se puede usar o no. */
#km-panel-container .rd-aviso { margin-top: 4px; font-size: 11.5px; line-height: 1.35; color: #B45309; }

/* Una fila de muestra corta no se esconde: se apaga. Esconderla haría pensar que no hay más datos. */
#km-panel-container .rd-corto { background: #FCFCFD; }
#km-panel-container .rd-corto td { color: var(--muted); }

#km-panel-container .rd-alta { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
#km-panel-container .rd-alta-tit { font-weight: 700; font-size: 13.5px; }
#km-panel-container .rd-alta-sub { margin-top: 5px; font-size: 12.5px; line-height: 1.6; color: var(--muted); max-width: 90ch; }
#km-panel-container .rd-alta-sub code { font-size: 11.5px; background: #f1f5f9; padding: 2px 5px; border-radius: 5px; }
#km-panel-container .rd-alta-form { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-top: 13px; }

#km-panel-container .rd-pie-cols { display: flex; flex-wrap: wrap; gap: 28px; font-size: 12.5px;
  line-height: 1.6; color: var(--muted); }
#km-panel-container .rd-pie-cols > div { flex: 1 1 300px; }
#km-panel-container .rd-pie-cols b { color: var(--ink); }

/* Etiqueta solo para lectores de pantalla: el campo lleva su placeholder, pero un input sin
   <label> asociado no se anuncia, y la fila de alta son tres seguidos. */
#km-panel-container .km-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── Radar: cabecera, pestañas y lista de clubes ────────────────────────────
   La pantalla iba en UNA columna con los cuatro bloques al mismo peso: lo que se
   arregla hoy, el aprendizaje a semanas, la lista de clubes (que se toca una vez
   al mes) y la nota de procedencia. Reportado: «parece una habitación
   desordenada». Ahora: tres números arriba, pestañas, y una cosa cada vez. */
.rd-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.rd-kpi { background: #fff; border: 1px solid var(--linea, #e6e3df); border-radius: 16px; padding: 16px 18px; }
.rd-kpi-rot { font-size: 11.5px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.rd-kpi-n { display: flex; align-items: baseline; gap: 9px; }
.rd-kpi-n b { font-size: 34px; line-height: 1; font-weight: 700; }
.rd-kpi-n span { font-size: 14px; color: var(--muted); }
/* Solo el que pide acción va en magenta: si los tres llamaran, no llamaría ninguno. */
.rd-kpi.acento .rd-kpi-rot, .rd-kpi.acento .rd-kpi-n b { color: #C2004D; }

.rd-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--linea, #e6e3df); margin-bottom: 20px; flex-wrap: wrap; }
.rd-tab {
  padding: 11px 17px; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--muted);
  background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer;
}
.rd-tab:hover { color: var(--ink); }
.rd-tab.on { color: var(--ink); font-weight: 700; border-bottom-color: #FF0066; }
.rd-tab-n { color: var(--muted); font-weight: 400; }
.rd-tab-n b { color: #C2004D; font-weight: 700; }

/* La lista de clubes: una fila por club, con su formulario de edición debajo. Antes
   era una tabla y no se podía editar nada: había que dar de baja y volver a dar de
   alta, lo que borra todo lo leído de ese club. */
.rd-clubes { display: flex; flex-direction: column; }
.rd-club { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--linea, #e6e3df); flex-wrap: wrap; }
.rd-club:last-child { border-bottom: 0; }
.rd-club-main { flex: 1 1 220px; min-width: 0; }
.rd-club-nom { font-size: 15.5px; font-weight: 700; }
.rd-club-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.rd-club-sub .rd-falta { color: #b45309; }
.rd-club-estado { flex: 0 0 auto; font-size: 13px; }
.rd-club-acc { flex: 0 0 auto; display: flex; gap: 6px; }
.rd-club-form { flex: 1 1 100%; padding: 12px 0 2px; }

/* Lo que aún no concluye nada, plegado. Es donde vivía el desorden: once de doce
   filas diciendo «por debajo de 5 no concluyo nada», a la misma altura que la única
   que sí concluía. */
.rd-flojos { margin-top: 16px; border-top: 1px solid var(--linea, #e6e3df); padding-top: 4px; }
.rd-flojos summary { list-style: none; cursor: pointer; padding: 12px 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.rd-flojos summary::-webkit-details-marker { display: none; }
.rd-flojos summary:hover { color: var(--ink); }
.rd-flojos-cuerpo p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.rd-chips { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 14px; }
.rd-chip { font-size: 12.5px; background: var(--fill, #f3f1ee); border-radius: 999px; padding: 5px 11px; }
.rd-chip b { font-weight: 700; }
.rd-chip-mas { font-size: 12.5px; color: var(--muted); padding: 5px 2px; }

@media (max-width: 820px) {
  .rd-kpis { grid-template-columns: 1fr; gap: 10px; }
  .rd-kpi-n b { font-size: 28px; }
}
