/* Vista «Reseñas». Todo con prefijo res- y con las variables de style.css (el modo oscuro sale solo). */
.res-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Barra de filtros propia */
.res-barra { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end; margin: 12px 0 4px; padding: 12px; border: 1px solid var(--linea); border-radius: 12px; background: var(--panel); }
.res-barra label { min-width: 140px; }
.res-barra input[type="date"] { min-width: 0; }
.res-atajos { display: flex; flex-wrap: wrap; gap: 4px; }
.res-atajos button { padding: 6px 10px; }
.res-atajos button[aria-pressed="true"], .res-graf-ctl button:focus-visible { border-color: var(--acento); }
.res-atajos button[aria-pressed="true"] { background: var(--acento); color: var(--acento-t); font-weight: 600; }
.res-check { display: flex !important; align-items: center; gap: 8px; min-height: 38px; color: var(--texto); min-width: 0 !important; }
.res-check input { min-height: 0; width: 18px; height: 18px; padding: 0; accent-color: var(--acento); }
.res-estado { font-size: .82rem; color: var(--suave); min-height: 1em; }

/* Panel por inmueble */
.res-tabla { position: relative; max-height: none; }   /* todas las filas visibles: la de «Media del grupo» no queda escondida en un scroll interior */
.res-tabla th { vertical-align: bottom; }
.res-th { border: 0; background: none; padding: 2px 0; min-height: 0; font: inherit; font-weight: 600; color: inherit; cursor: pointer; text-align: inherit; white-space: nowrap; }
.res-th:hover { color: var(--acento); text-decoration: underline; }
.res-inm { border: 0; background: none; padding: 2px 0; min-height: 0; font: inherit; font-weight: 600; color: var(--acento); text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--acento) 40%, transparent); }
.res-inm[aria-pressed="true"] { text-decoration-thickness: 2px; }
.res-tabla tr.res-sel td, .res-tabla tr.res-sel th { background: color-mix(in srgb, var(--acento) 14%, var(--panel)); }
.res-tabla tr.res-fuera td, .res-tabla tr.res-fuera th { color: var(--suave); }
.res-tabla tr.total td, .res-tabla tr.total th { background: var(--bg); font-weight: 700; border-top: 2px solid var(--linea); }
.res-n { color: var(--suave); font-size: .76rem; }
.res-regla { line-height: 1.5; max-width: 110ch; }
.res-tend { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--linea); color: var(--texto); white-space: nowrap; }
.res-tend.res-sube { background: var(--ok-bg); color: var(--ok); }
.res-tend.res-baja { background: var(--rojo-bg); color: var(--rojo); }
.res-tend.res-nd { background: transparent; color: var(--suave); border: 1px dashed var(--suave); }
.kpi .v .res-tend { font-size: 1rem; vertical-align: middle; }

/* Gráfico */
.res-graf { margin-top: 18px; }
.res-h { margin: 0 0 .5rem; }
.res-graf-ctl { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.res-graf-ctl button { padding: 5px 10px; min-height: 34px; font-size: .85rem; }
.res-grafico { height: 440px; width: 100%; }
@media (max-width: 520px) { .res-grafico { height: 380px; } }

/* Tabla mes a mes (mapa de calor: número siempre visible, el color solo refuerza) */
.res-tmes table { font-size: .8rem; }
.res-tmes th, .res-tmes td { padding: 4px 6px; }
.res-tmes tbody th { position: sticky; left: 0; background: var(--panel); z-index: 1; font-weight: 600; max-width: 220px; white-space: normal; min-width: 130px; }
.res-tmes thead th:first-child { left: 0; z-index: 3; }
.res-celda { padding: 2px !important; }
.res-celda button { width: 100%; min-height: 32px; padding: 4px 6px; border: 0; border-radius: 6px; background: transparent; color: var(--texto); font: inherit; font-variant-numeric: tabular-nums; white-space: nowrap; }
.res-celda button small { color: var(--suave); }
.res-celda button:hover { outline: 2px solid var(--acento); outline-offset: -2px; }
.res-celda button[aria-pressed="true"] { outline: 3px solid var(--acento); outline-offset: -3px; font-weight: 700; }
.res-c4, .res-celda.res-c4 button { background: color-mix(in srgb, var(--ok) 34%, var(--panel)); }
.res-c3, .res-celda.res-c3 button { background: color-mix(in srgb, var(--ok) 14%, var(--panel)); }
.res-c2, .res-celda.res-c2 button { background: var(--ambar-bg); }
.res-c1, .res-celda.res-c1 button { background: var(--rojo-bg); }
.res-celda.res-poca button, .res-ley .res-poca { font-style: italic; opacity: .62; }
.res-vacia { color: var(--suave); text-align: center !important; }
.res-ley { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.res-ley span { padding: 1px 8px; border-radius: 6px; color: var(--texto); }

/* Comentarios */
#res-comentarios { scroll-margin-top: 80px; }
#res-com-titulo:focus { outline: none; }
#res-com-titulo:focus-visible { outline: 2px solid var(--acento); }
.res-com-ctl { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-bottom: 4px; }
.res-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1 1 100%; }
.res-chips-t { font-size: .82rem; color: var(--suave); }
.res-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 3px 2px 10px; border-radius: 999px; background: var(--ambar-bg); color: var(--texto); border: 1px solid var(--linea); font-size: .85rem; max-width: 100%; overflow-wrap: anywhere; }
.res-quitar { min-height: 28px; min-width: 28px; padding: 0 8px; border-radius: 999px; line-height: 1; font-size: .85rem; }
.res-pag { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: center; margin: 12px 0; }

@media (max-width: 520px) {
  .res-barra { padding: 10px; }
  .res-barra label { min-width: 0; flex: 1 1 140px; }
  .res-tmes tbody th { min-width: 100px; max-width: 120px; font-size: .76rem; }
}

/* número de reseñas pulsable en la tabla por inmueble: filtra el listado de abajo (resenas.js · conteo) */
.res-num { border: 0; background: none; padding: 2px 4px; min-height: 0; font: inherit; color: var(--acento); cursor: pointer; text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--acento) 40%, transparent); border-radius: 4px; }
.res-num:hover { text-decoration-thickness: 2px; }
.res-num[aria-pressed="true"] { background: color-mix(in srgb, var(--acento) 14%, transparent); font-weight: 700; }
.res-num .res-n { color: inherit; }
.res-foco { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; margin: 6px 0; padding: 8px 12px;
  border-radius: 10px; background: color-mix(in srgb, var(--acento) 9%, var(--panel)); border: 1px solid var(--linea); font-size: .9rem; }
.res-quitar-foco { min-height: 32px; padding: 4px 12px; }

/* Nota que publica Booking en su ficha: círculo azul oscuro de Booking con el número en blanco (09/11/2026). Contraste blanco sobre #003580: 12,6:1. */
.res-bk-td { text-align: center; }
.res-bk { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 2.45em; height: 2.45em; border-radius: 50%;
  background: #003580; color: #ffffff; font-weight: 700; font-size: .9rem; line-height: 1; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px color-mix(in srgb, #ffffff 22%, transparent); cursor: help; }

/* Tabla de inmuebles agrupada por ciudad: fila de título en color fuerte (09/11/2026) */
.res-tabla tr.res-ciudad td { background: var(--acento); color: var(--acento-t); font-weight: 800; letter-spacing: .12em; font-size: .95rem; padding: 8px 12px;
  text-align: left; border-top: 4px solid var(--panel); border-bottom: 0; }
.res-tabla tr.res-ciudad small { font-weight: 600; letter-spacing: 0; margin-left: 12px; opacity: .85; }

/* Columna «Sin responder»: 0 % en negrita y verde; cualquier otro valor en negrita y rojo (JM, 09/11/2026). Colores del tema (cambian solos en modo oscuro). */
.res-sr-ok { color: var(--ok); font-weight: 800; }
.res-sr-mal { color: var(--rojo); font-weight: 800; }

/* Cabeceras del panel por inmueble en dos líneas si hace falta (JM, 12/11/2026: «títulos cortados en las columnas»): con 12 columnas en una
   sola línea la tabla no cabía y los títulos de los extremos quedaban fuera del recuadro. Solo parte el texto del título (el botón); la flecha
   de orden va pegada a la última palabra y el embudo de tablas.js se queda a su lado. */
.res-tabla:not(.res-tmes) thead th { line-height: 1.2; vertical-align: bottom; }
.res-tabla:not(.res-tmes) .res-th { white-space: normal; display: inline-block; max-width: 7.5em; vertical-align: bottom; }
.res-tabla:not(.res-tmes) thead th:first-child .res-th { max-width: none; }
.res-tabla:not(.res-tmes) .tb-ctl { vertical-align: bottom; }
