/* ============================================================
   SOS Mi Gente: mg-tablero.css — tablero publico de necesidades
   Depende de mg-brand.css (tokens, tipografia, botones, selector).
   Mismo lenguaje que la portada: ficha compacta en rejilla, la
   cifra que falta como dato principal y la urgencia en un riel de
   color acompanada SIEMPRE de su etiqueta escrita.
   ============================================================ */

body.tablero .main-content { max-width: 1240px; padding: 0 18px 60px; }

/* ---------------- cabecera ---------------- */
.tb-cab { display: grid; gap: 8px; padding-block: clamp(22px, 3vw, 38px) 18px; }
body.tablero .tb-cab h1.display { font-size: clamp(28px, 3.2vw, 42px); line-height: 1.06; }
.tb-cab p { color: var(--ink-2); font-size: 15px; max-width: 62ch; }

/* ---------------- pestañas segmentadas ---------------- */
body.tablero .tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin-bottom: 14px;
    border: 1px solid var(--hairline); border-radius: var(--r-full);
    background: var(--paper); width: fit-content; max-width: 100%; }
body.tablero .tabs .tab { border: 0; border-radius: var(--r-full); background: none; cursor: pointer;
    font: inherit; font-size: 14px; font-weight: 700; color: var(--ink-2);
    min-height: 40px; padding: 0 18px; white-space: nowrap;
    transition: background .18s, color .18s; }
body.tablero .tabs .tab:hover { background: var(--page); }
body.tablero .tabs .tab.active { background: var(--ink); color: #fff; }
body.tablero .tabs .tab:focus-visible { outline: 2px solid var(--sos); outline-offset: 2px; }

/* ---------------- filtros ---------------- */
.tb-filtros { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }
.tb-filtros .form-group { display: grid; gap: 0; }
body.tablero .sel-boton { min-height: 46px; padding: 11px 14px; font-size: 14.5px; }
body.tablero .sel-boton .flecha { margin-left: auto; }
.tb-busca { position: relative; display: block; }
.tb-busca .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 17px; height: 17px; color: var(--ink-3); pointer-events: none; transition: color .16s; }
.tb-busca:focus-within .ico { color: var(--sos); }
body.tablero #filterSearch {
    width: 100%; min-height: 46px; padding: 11px 14px 11px 42px;
    border: 1.5px solid var(--hairline); border-radius: var(--r-sm);
    background: var(--paper); font: inherit; font-size: 15px; color: var(--ink);
    transition: border-color .16s, box-shadow .16s; }
body.tablero #filterSearch::placeholder { color: #9AA29D; }
body.tablero #filterSearch:hover { border-color: #CFC8BC; }
body.tablero #filterSearch:focus { outline: none; border-color: var(--sos);
    box-shadow: 0 0 0 3px rgba(240,64,42,.14); }

.tb-estado { display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    margin-bottom: 16px; font-size: 13.5px; color: var(--ink-2); }
.tb-estado b { color: var(--ink); }
.tb-estado .punto { width: 7px; height: 7px; border-radius: 50%; background: var(--verde); }

/* ---------------- ficha de necesidad ----------------
   Tres bloques con ritmo propio: quien y cuando, que se pide, y
   como va. Dentro de cada bloque el hueco es corto (4-6px) y entre
   bloques largo (16px): eso es lo que crea jerarquia. Antes eran
   siete elementos sueltos a la misma distancia.
   ------------------------------------------------- */
body.tablero .cards-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }

.nec {
    position: relative; display: flex; flex-direction: column;
    padding: 0 0 0 3px; overflow: hidden;
    border: 1px solid var(--hairline); border-radius: var(--r-lg);
    background: var(--paper); cursor: pointer;
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.nec:hover { border-color: var(--ink); transform: translateY(-3px); box-shadow: var(--sh-2); }
.nec:focus-within { border-color: var(--sos); box-shadow: 0 0 0 3px rgba(240,64,42,.12); }
/* riel de urgencia para barrer la rejilla de un vistazo; el significado
   siempre va escrito al lado, el color nunca viaja solo */
.nec::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--hairline); }
.nec.u-critica::before, .nec.u-alta::before { background: var(--dato); }
.nec.u-media::before { background: #E9A23B; }
.nec.u-baja::before  { background: #9AA6A0; }

.nec-cuerpo { display: flex; flex-direction: column; gap: 16px; padding: 16px 18px 14px; flex: 1; }

/* bloque 1 · quien y cuando */
.nec-cabeza { display: grid; gap: 5px; }
.nec-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
.nec-urg { font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.nec.u-critica .nec-urg, .nec.u-alta .nec-urg { color: var(--dato); }
.nec.u-media .nec-urg { color: #9A6412; }
.nec.u-baja  .nec-urg { color: var(--ink-3); }
.nec-cuando { margin-left: auto; color: var(--ink-3); white-space: nowrap; }
.nec-tit { font-size: 19px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nec-donde { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-2);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nec-donde .ico { width: 13px; height: 13px; color: var(--ink-3); flex: 0 0 13px; }

/* bloque 2 · cuanto falta, con su barra pegada debajo */
.nec-dato { display: grid; gap: 6px; }
.nec-falta { display: flex; align-items: baseline; gap: 7px; }
.nec-falta b { font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: 32px; font-weight: 800; line-height: .95; letter-spacing: -.035em; color: var(--dato); }
.nec-falta span { font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.nec-falta.hecho b { color: var(--verde-ink); }
body.tablero .nec .progress { height: 6px; }
.nec-contexto { display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    font-size: 11.5px; color: var(--ink-3); }
.nec-camino { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px;
    border-radius: var(--r-full); background: #FFF4E2; color: #8A5A12; font-weight: 700; }
.nec-camino .ico { width: 12px; height: 12px; }

/* bloque 3 · la accion. Es un enlace, no un boton: lleva al detalle, no
   ejecuta el compromiso. Cinco botones rojos llenos hacian gritar la rejilla. */
.nec-ir { display: flex; align-items: center; justify-content: space-between; gap: 10px;
    margin-top: auto; padding: 12px 18px; border-top: 1px solid var(--line-2);
    font-size: 14px; font-weight: 700; color: var(--ink);
    text-decoration: none; transition: background .18s, color .18s; }
.nec-ir:hover, .nec:hover .nec-ir { background: var(--sos-soft); color: var(--sos-ink); text-decoration: none; }
.nec-ir .ico { width: 16px; height: 16px; color: var(--sos); transition: transform .2s; }
.nec:hover .nec-ir .ico { transform: translateX(4px); }
.nec-ir:focus-visible { outline: 2px solid var(--sos); outline-offset: -2px; }

/* ---------------- vacio, carga y paginacion ---------------- */
body.tablero .empty { display: grid; justify-items: center; gap: 10px; padding: 54px 24px;
    border: 1px dashed var(--hairline); border-radius: var(--r-lg); text-align: center; }
body.tablero .empty .ico { width: 34px; height: 34px; color: var(--ink-3); }
body.tablero .empty b { font-size: 17px; }
body.tablero .empty p { color: var(--ink-2); font-size: 14.5px; margin: 0; max-width: 44ch; }
.tb-esqueleto { display: grid; gap: 10px; padding: 18px; border: 1px solid var(--hairline);
    border-radius: var(--r-lg); background: var(--paper); }
.tb-esqueleto i { display: block; height: 12px; border-radius: 6px;
    background: linear-gradient(90deg, var(--line-2), var(--hairline), var(--line-2));
    background-size: 200% 100%; animation: brilla 1.2s linear infinite; }
.tb-esqueleto i:nth-child(1) { width: 40%; }
.tb-esqueleto i:nth-child(2) { width: 72%; height: 20px; }
.tb-esqueleto i:nth-child(3) { width: 100%; }
.tb-esqueleto i:nth-child(4) { width: 55%; }
@keyframes brilla { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.load-more { display: flex; justify-content: center; margin-top: 22px; }

@media (min-width: 620px) {
    .tb-filtros { grid-template-columns: repeat(3, 1fr) minmax(200px, 1.3fr); }
    body.tablero .cards-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
    body.tablero .cards-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .nec, .nec-cta, .nec-cta .ico { transition: none; }
    .nec:hover { transform: none; }
    .tb-esqueleto i { animation: none; }
}
