/* RCAD v263 — portada del foro tipo XenForo. Única hoja del índice. */
body.rcad-forum-home #bbpress-forums > ul.bbp-forums,
body.rcad-forum-home #bbpress-forums .rcad-forum-home-heading-row {
  display:none !important;
}

body.rcad-forum-home .rcad-forum-index-v262{
  display:grid;
  gap:18px;
  width:100%;
  margin:0;
  color:#071b46;
}

body.rcad-forum-home .rcad-fi262-group{
  overflow:hidden;
  border:1px solid #dce4ef;
  border-radius:9px;
  background:#fff;
}

body.rcad-forum-home .rcad-fi262-group__title{
  padding:12px 18px;
  border-bottom:1px solid #071b46;
  background:#071b46;
  color:#fff;
  font-size:20px;
  font-weight:800;
  line-height:1.3;
}
body.rcad-forum-home .rcad-fi262-group__title a,
body.rcad-forum-home .rcad-fi262-group__title a:link,
body.rcad-forum-home .rcad-fi262-group__title a:visited,
body.rcad-forum-home .rcad-fi262-group__title a:hover,
body.rcad-forum-home .rcad-fi262-group__title a:focus,
body.rcad-forum-home .rcad-fi262-group__title a:active{
  color:#fff !important;
  text-decoration:none !important;
  background:transparent !important;
}

body.rcad-forum-home .rcad-fi262-table{width:100%;}
body.rcad-forum-home .rcad-fi262-head,
body.rcad-forum-home .rcad-fi262-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 82px 92px minmax(240px,300px);
  align-items:stretch;
}
body.rcad-forum-home .rcad-fi262-head{
  min-height:38px;
  background:#f8fafc;
  border-bottom:1px solid #e2e8f0;
  color:#64748b;
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.025em;
}
body.rcad-forum-home .rcad-fi262-head>div{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:8px 12px;
  border-left:1px solid #e6ebf2;
}
body.rcad-forum-home .rcad-fi262-head>div:first-child{
  justify-content:flex-start;
  border-left:0;
  padding-left:20px;
}

body.rcad-forum-home .rcad-fi262-row{
  min-height:92px;
  border-bottom:1px solid #e2e8f0;
  transition:background .12s ease;
}
body.rcad-forum-home .rcad-fi262-row:last-child{border-bottom:0;}
body.rcad-forum-home .rcad-fi262-row:hover{background:#fbfdff;}

body.rcad-forum-home .rcad-fi262-forum{
  display:grid;
  grid-template-columns:46px minmax(0,1fr);
  align-items:center;
  gap:14px;
  padding:16px 20px;
  min-width:0;
}
body.rcad-forum-home .rcad-fi262-icon{
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  border-radius:50%;
  background:#fff7e6;
  color:#f6a800;
}
body.rcad-forum-home .rcad-fi262-icon svg{
  width:24px;
  height:24px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
body.rcad-forum-home .rcad-fi262-forum__copy{min-width:0;}
body.rcad-forum-home .rcad-fi262-forum__title{
  display:inline-block;
  color:#0868b9 !important;
  font-size:15px;
  font-weight:700;
  line-height:1.3;
  text-decoration:none !important;
}
body.rcad-forum-home .rcad-fi262-forum__title:hover{text-decoration:underline !important;}
body.rcad-forum-home .rcad-fi262-forum__desc{
  margin:4px 0 0 !important;
  color:#69778b;
  font-size:12px;
  line-height:1.4;
}

body.rcad-forum-home .rcad-fi262-count{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  padding:12px 8px;
  border-left:1px solid #e6ebf2;
  text-align:center;
}
body.rcad-forum-home .rcad-fi262-count strong{
  color:#071b46;
  font-size:15px;
  font-weight:750;
  line-height:1;
}
body.rcad-forum-home .rcad-fi262-count span{
  color:#7a8799;
  font-size:10px;
  line-height:1;
}

body.rcad-forum-home .rcad-fi262-latest{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  padding:13px 16px;
  border-left:1px solid #e6ebf2;
}
body.rcad-forum-home .rcad-fi262-latest__avatar,
body.rcad-forum-home .rcad-fi262-latest__avatar--empty{
  flex:0 0 38px;
  width:38px !important;
  height:38px !important;
  margin:0 !important;
  border:1px solid #d7e0ec;
  border-radius:50% !important;
  object-fit:cover;
  background:#eef3f8;
}
body.rcad-forum-home .rcad-fi262-latest__copy{min-width:0;}
body.rcad-forum-home .rcad-fi262-latest__title{
  display:block;
  overflow:hidden;
  color:#0868b9 !important;
  font-size:12.5px;
  font-weight:650;
  line-height:1.3;
  text-decoration:none !important;
  text-overflow:ellipsis;
  white-space:nowrap;
}
body.rcad-forum-home .rcad-fi262-latest__title:hover{text-decoration:underline !important;}
body.rcad-forum-home .rcad-fi262-latest__meta{
  display:flex;
  flex-wrap:wrap;
  gap:2px 6px;
  margin-top:4px;
  color:#7a8799;
  font-size:10.5px;
  line-height:1.25;
}
body.rcad-forum-home .rcad-fi262-latest__meta strong{color:#44536a;font-weight:600;}
body.rcad-forum-home .rcad-fi262-empty{color:#8a96a7;font-size:12px;}

@media (max-width:900px){
  body.rcad-forum-home .rcad-fi262-head{display:none;}
  body.rcad-forum-home .rcad-fi262-row{
    grid-template-columns:minmax(0,1fr) 70px 78px;
    grid-template-areas:"forum topics posts" "latest latest latest";
  }
  body.rcad-forum-home .rcad-fi262-forum{grid-area:forum;}
  body.rcad-forum-home .rcad-fi262-row>.rcad-fi262-count:nth-of-type(2){grid-area:topics;}
  body.rcad-forum-home .rcad-fi262-row>.rcad-fi262-count:nth-of-type(3){grid-area:posts;}
  body.rcad-forum-home .rcad-fi262-latest{
    grid-area:latest;
    border-left:0;
    border-top:1px solid #edf1f6;
    padding-left:80px;
  }
}

@media (max-width:600px){
  body.rcad-forum-home .rcad-fi262-group{border-radius:7px;}
  body.rcad-forum-home .rcad-fi262-group__title{padding:10px 13px;font-size:18px;}
  body.rcad-forum-home .rcad-fi262-row{
    grid-template-columns:minmax(0,1fr) 62px 68px;
  }
  body.rcad-forum-home .rcad-fi262-forum{
    grid-template-columns:38px minmax(0,1fr);
    gap:10px;
    padding:13px 10px;
  }
  body.rcad-forum-home .rcad-fi262-icon{width:36px;height:36px;}
  body.rcad-forum-home .rcad-fi262-icon svg{width:20px;height:20px;}
  body.rcad-forum-home .rcad-fi262-forum__title{font-size:13px;}
  body.rcad-forum-home .rcad-fi262-forum__desc{font-size:11px;}
  body.rcad-forum-home .rcad-fi262-count{padding:10px 4px;}
  body.rcad-forum-home .rcad-fi262-count strong{font-size:13px;}
  body.rcad-forum-home .rcad-fi262-count span{font-size:9px;}
  body.rcad-forum-home .rcad-fi262-latest{padding:10px 10px 10px 58px;}
  body.rcad-forum-home .rcad-fi262-latest__avatar,
  body.rcad-forum-home .rcad-fi262-latest__avatar--empty{width:32px !important;height:32px !important;flex-basis:32px;}
}

/* RCAD v263 — fijación quirúrgica de columnas del índice.
   Evita que estilos globales de article/bbPress desplacen Temas, Mensajes y Último mensaje. */
@media (min-width:901px){
  body.rcad-forum-home #bbpress-forums .rcad-forum-index-v262 .rcad-fi262-head,
  body.rcad-forum-home #bbpress-forums .rcad-forum-index-v262 article.rcad-fi262-row{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) 82px 92px minmax(240px,300px) !important;
    grid-template-areas:"forum topics messages latest" !important;
    width:100% !important;
  }
  body.rcad-forum-home #bbpress-forums .rcad-fi262-head > div:nth-child(1),
  body.rcad-forum-home #bbpress-forums .rcad-fi262-row > .rcad-fi262-forum{grid-area:forum !important;}
  body.rcad-forum-home #bbpress-forums .rcad-fi262-head > div:nth-child(2),
  body.rcad-forum-home #bbpress-forums .rcad-fi262-row > .rcad-fi262-count:nth-child(2){grid-area:topics !important;}
  body.rcad-forum-home #bbpress-forums .rcad-fi262-head > div:nth-child(3),
  body.rcad-forum-home #bbpress-forums .rcad-fi262-row > .rcad-fi262-count:nth-child(3){grid-area:messages !important;}
  body.rcad-forum-home #bbpress-forums .rcad-fi262-head > div:nth-child(4),
  body.rcad-forum-home #bbpress-forums .rcad-fi262-row > .rcad-fi262-latest{grid-area:latest !important;}

  body.rcad-forum-home #bbpress-forums .rcad-fi262-row > .rcad-fi262-forum,
  body.rcad-forum-home #bbpress-forums .rcad-fi262-row > .rcad-fi262-count,
  body.rcad-forum-home #bbpress-forums .rcad-fi262-row > .rcad-fi262-latest{
    position:static !important;
    float:none !important;
    width:auto !important;
    max-width:none !important;
    margin:0 !important;
    box-sizing:border-box !important;
  }
  body.rcad-forum-home #bbpress-forums .rcad-fi262-latest{
    display:flex !important;
    align-items:center !important;
    justify-content:flex-start !important;
  }
}

/* RCAD v264 — portada: una sola representación de los foros.
   El índice nuevo v262 es la fuente visual única; el loop bbPress heredado
   permanece en el DOM por compatibilidad, pero no se pinta en /forums/. */
body.rcad-forum-home #bbpress-forums > ul.bbp-forums,
body.rcad-forum-home #bbpress-forums .rcad-forum-home-main > ul.bbp-forums,
body.rcad-forum-home #bbpress-forums .bbp-forums:not(.rcad-forum-index-v262 *) {
    display: none !important;
}

/* Evita huecos heredados del bloque antiguo después del índice nuevo. */
body.rcad-forum-home .rcad-forum-index-v262 + ul.bbp-forums,
body.rcad-forum-home .rcad-forum-index-v262 ~ ul.bbp-forums {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

/* ============================================================
   RCAD v267 — PORTADA /forums/ LIMPIA
   Una sola fuente de layout. No usa .rcad-forum-home-sidebar,
   evitando los selectores legacy de bbpress.css/layout/xenforo.
   ============================================================ */
body.rcad-forum-home .rcad-forum-index-v265-layout{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 320px!important;
  gap:24px!important;
  align-items:start!important;
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  padding:0!important;
  box-sizing:border-box!important;
}
body.rcad-forum-home .rcad-forum-index-v265-main{
  grid-column:1!important; min-width:0!important; width:100%!important; margin:0!important; padding:0!important;
}
body.rcad-forum-home .rcad-forum-index-v265-layout > .rcad-forum-index-sidebar-v267{
  grid-column:2!important; grid-row:1!important; display:grid!important;
  position:static!important; float:none!important; clear:none!important;
  width:320px!important; min-width:320px!important; max-width:320px!important;
  margin:0!important; padding:0!important; gap:14px!important; align-self:start!important;
  transform:none!important; inset:auto!important; visibility:visible!important; opacity:1!important;
}
@media(max-width:980px){
 body.rcad-forum-home .rcad-forum-index-v265-layout{grid-template-columns:1fr!important;}
 body.rcad-forum-home .rcad-forum-index-v265-layout > .rcad-forum-index-sidebar-v267{
   grid-column:1!important; grid-row:2!important; width:100%!important; min-width:0!important; max-width:none!important;
 }
}

/* ============================================================
   RCAD v268 — limpieza final del índice + sidebar visual suave
   ============================================================ */
/* El loop bbPress legacy nunca debe ocupar espacio en la portada. */
body.rcad-forum-home #bbpress-forums > ul.bbp-forums,
body.rcad-forum-home #bbpress-forums > .bbp-forums,
body.rcad-forum-home #bbpress-forums ul.bbp-forums,
body.rcad-forum-home #bbpress-forums .bbp-forums,
body.rcad-forum-home #bbpress-forums .bbp-template-notice + ul.bbp-forums{
  display:none!important; height:0!important; min-height:0!important; overflow:hidden!important;
  margin:0!important; padding:0!important; border:0!important;
}
/* Excepción explícita para nuestro índice (no usa .bbp-forums, se documenta por seguridad). */
body.rcad-forum-home .rcad-forum-index-v262{display:block!important;height:auto!important;overflow:visible!important}

/* Sidebar v268: mismo lenguaje visual que las tablas nuevas. */
body.rcad-forum-home .rcad-forum-index-sidebar-v267{
  gap:10px!important;
  font-size:13px!important;
  color:#334155!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-forum-side-actions{
  display:grid!important; gap:8px!important; margin:0!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-forum-side-new{
  min-height:40px!important; border-radius:6px!important; border:1px solid #e6a000!important;
  background:#fff!important; color:#0b2a59!important; box-shadow:none!important;
  font-weight:700!important; font-size:13px!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-forum-side-new:hover{
  background:#fff8e8!important; color:#071b46!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-forum-side-new__icon{color:#f6a800!important;width:16px!important;height:16px!important}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-forum-side-search-form{
  margin:0!important; padding:0!important; border:0!important; background:transparent!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-forum-side-search-wrap{
  min-height:40px!important; border:1px solid #dbe3ef!important; border-radius:6px!important;
  background:#fff!important; box-shadow:none!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-forum-side-search-input{
  color:#334155!important; font-size:12px!important; background:transparent!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-forum-side-search-button{
  min-height:30px!important; margin:4px!important; padding:0 12px!important; border:0!important;
  border-radius:5px!important; background:#071b46!important; color:#fff!important; font-size:11px!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-forum-side-card{
  margin:0!important; padding:14px!important; border:1px solid #dbe3ef!important;
  border-radius:6px!important; background:#fff!important; box-shadow:none!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-forum-side-title{
  margin:0 0 8px!important; padding:0 0 8px!important; border-bottom:1px solid #edf1f6!important;
  color:#071b46!important; font-size:14px!important; line-height:1.25!important; font-weight:700!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-active-topic,
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-latest-reply{
  padding:9px 0!important; border:0!important; border-bottom:1px solid #edf1f6!important;
  background:transparent!important; border-radius:0!important; box-shadow:none!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-active-topic:last-child,
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-latest-reply:last-child{border-bottom:0!important}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-active-topic__avatar{
  width:28px!important;height:28px!important;min-width:28px!important;border-radius:50%!important;
  background:#f3f6fa!important;color:#49627f!important;border:1px solid #dbe3ef!important;font-size:11px!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-active-topic__copy strong,
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-latest-reply__copy strong{
  color:#17365f!important;font-size:12px!important;line-height:1.35!important;font-weight:600!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-active-topic__copy small,
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-latest-reply__copy small,
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-online-total,
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-forum-side-empty{
  color:#7b8ba1!important;font-size:11px!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-active-topic__count{
  min-width:24px!important;height:22px!important;padding:0 6px!important;border-radius:5px!important;
  background:#f3f6fa!important;color:#49627f!important;border:1px solid #e4eaf2!important;font-size:11px!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-latest-reply__avatar-img{
  width:30px!important;height:30px!important;border-radius:50%!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-forum-stats-list div{
  padding:6px 0!important;border-bottom:1px solid #edf1f6!important;color:#53657d!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-forum-stats-list div:last-child{border-bottom:0!important}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-forum-stats-list dd{color:#17365f!important;font-weight:700!important}

/* ==========================================================
   RCAD v302 — Sidebar portada: avatares amarillos + estadísticas con iconos
   ========================================================== */
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-active-topic__avatar{
  background:#f6a800!important;
  color:#071b46!important;
  border-color:#f6a800!important;
  font-weight:800!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-forum-stats-card-v302{
  padding:16px!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-forum-stats-card-v302 .rcad-forum-side-title{
  margin-bottom:4px!important;
  padding-bottom:10px!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-forum-stats-list-v302{
  display:block!important;
  margin:0!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-forum-stats-list-v302>div{
  display:grid!important;
  grid-template-columns:36px minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:10px!important;
  min-height:54px!important;
  padding:8px 0!important;
  border-bottom:1px solid #edf1f6!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-forum-stats-list-v302>div:last-child{
  border-bottom:0!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-forum-stat-icon{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:34px!important;
  height:34px!important;
  border-radius:50%!important;
  background:#f6a800!important;
  color:#071b46!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-forum-stat-icon svg{
  width:18px!important;
  height:18px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.9!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-forum-stats-list-v302 dt{
  margin:0!important;
  color:#071b46!important;
  font-size:12.5px!important;
  line-height:1.25!important;
  font-weight:600!important;
}
body.rcad-forum-home .rcad-forum-index-sidebar-v267 .rcad-forum-stats-list-v302 dd{
  margin:0!important;
  color:#071b46!important;
  font-size:13px!important;
  line-height:1!important;
  font-weight:800!important;
  text-align:right!important;
  white-space:nowrap!important;
}
/* El índice personalizado sustituye por completo al loop bbPress inferior. */
body.rcad-forum-home #bbpress-forums > ul.bbp-forums,
body.rcad-forum-home #bbpress-forums > .bbp-pagination,
body.rcad-forum-home #bbpress-forums > .bbp-template-notice + ul.bbp-forums{
  display:none!important;
}

/* ============================================================
   RCAD v307 — FIX DEFINITIVO: sidebar de /forums/ en la primera fila
   La instalación activa todavía puede renderizar la retícula legacy
   .rcad-forum-home-grid. Forzamos main y sidebar a compartir fila 1.
   ============================================================ */
body.rcad-forum-home #bbpress-forums .rcad-forum-home-grid{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 320px!important;
  gap:24px!important;
  align-items:start!important;
}
body.rcad-forum-home #bbpress-forums .rcad-forum-home-grid > .rcad-forum-home-main{
  grid-column:1!important;
  grid-row:1!important;
  align-self:start!important;
  min-width:0!important;
}
body.rcad-forum-home #bbpress-forums .rcad-forum-home-grid > .rcad-forum-home-sidebar,
body.rcad-forum-home #bbpress-forums .rcad-forum-home-grid > .rcad-forum-interior-sidebar.rcad-forum-home-sidebar{
  grid-column:2!important;
  grid-row:1!important;
  align-self:start!important;
  position:static!important;
  float:none!important;
  clear:none!important;
  width:320px!important;
  min-width:320px!important;
  max-width:320px!important;
  margin:0!important;
  transform:none!important;
}
@media(max-width:980px){
  body.rcad-forum-home #bbpress-forums .rcad-forum-home-grid{grid-template-columns:1fr!important;}
  body.rcad-forum-home #bbpress-forums .rcad-forum-home-grid > .rcad-forum-home-main{grid-column:1!important;grid-row:1!important;}
  body.rcad-forum-home #bbpress-forums .rcad-forum-home-grid > .rcad-forum-home-sidebar,
  body.rcad-forum-home #bbpress-forums .rcad-forum-home-grid > .rcad-forum-interior-sidebar.rcad-forum-home-sidebar{
    grid-column:1!important;grid-row:2!important;width:100%!important;min-width:0!important;max-width:none!important;
  }
}

/* RCAD v308 — La portada nueva ya tiene su sidebar dentro de
   .rcad-forum-index-v265-layout. El aside legacy que el padre
   imprime como hijo directo de #bbpress-forums no debe pintarse. */
body.rcad-forum-home #bbpress-forums > .rcad-forum-home-sidebar:not(.rcad-forum-index-sidebar-v267){
  display:none!important;
}


/* RCAD v309 — El índice nuevo ya está en .rcad-forum-index-v265-layout.
   Oculta de inmediato el grid bbPress legacy inferior aunque el JS antiguo
   alcance a envolverlo antes de que corra la limpieza de v309. */
body.rcad-forum-home #bbpress-forums > .rcad-forum-home-grid{
  display:none!important;
}
body.rcad-forum-home #bbpress-forums > ul.bbp-forums{
  display:none!important;
}
