/*
 * NUBO_DASHBOARD_TOP3_NATURAL_V1_START
 *
 * Alcance exclusivo:
 * - Resumen.
 * - Gastos por categoría.
 * - Actividad reciente.
 * - Nubo IA del dashboard.
 *
 * No modifica Análisis, Metas, Deudas ni Reportes.
 */


/* =========================================================
   GRID CON ALTURAS NATURALES
   ========================================================= */


#app .finvia-v2-bottom {
  align-items:
    start !important;

  align-content:
    start !important;

  grid-auto-rows:
    max-content !important;
}


#app .finvia-v2-bottom
> .card,
#app .finvia-v2-bottom
> article {
  align-self:
    start !important;

  min-height:
    0 !important;

  height:
    auto !important;

  max-height:
    none !important;
}


/*
 * Anula la altura mínima de 362 px que obligaba a
 * las tres tarjetas de la primera fila a estirarse.
 */


#app .finvia-v2-category-card,
#app .finvia-v2-recent-card,
#app .finvia-v2-insights-card,
#app .finvia-v9-category-card {
  align-self:
    start !important;

  min-height:
    0 !important;

  height:
    auto !important;

  max-height:
    none !important;
}


/* El contenido tampoco debe ocupar el alto de la fila. */


#app .finvia-v2-category-content,
#app .finvia-v9-category-content,
#app .finvia-v2-category-list,
#app .finvia-v9-category-list,
#app .finvia-v2-recent,
#app .finvia-v2-insights {
  min-height:
    0 !important;

  height:
    auto !important;

  max-height:
    none !important;

  align-content:
    start !important;
}


/* =========================================================
   SOLO LOS TRES GASTOS PRINCIPALES
   ========================================================= */


/*
 * Esta regla funciona como protección visual incluso cuando
 * el render de JavaScript reciba más de tres categorías.
 */


#app .finvia-v9-category-card
.finvia-v9-category-list
> *:nth-child(n + 4),

#app .finvia-v9-category-card
.finvia-v9-category-items
> *:nth-child(n + 4),

#app .finvia-v2-category-card
.finvia-v2-category-list
> *:nth-child(n + 4),

#app .finvia-v2-category-card
.finvia-v2-category-items
> *:nth-child(n + 4) {
  display:
    none !important;
}


/*
 * La tarjeta termina inmediatamente después del tercer gasto.
 */


#app .finvia-v9-category-card
.finvia-v9-category-content,

#app .finvia-v2-category-card
.finvia-v2-category-content {
  padding-bottom:
    20px !important;
}


/* =========================================================
   ACTIVIDAD RECIENTE Y NUBO IA
   ========================================================= */


#app .finvia-v2-recent-card
.finvia-v2-recent,

#app .finvia-v2-insights-card
.finvia-v2-insights {
  flex:
    none !important;

  align-self:
    start !important;
}


/* Evita fondos internos extendidos hasta el final de la fila. */


#app .finvia-v2-recent-card::after,
#app .finvia-v2-insights-card::after,
#app .finvia-v2-category-card::after,
#app .finvia-v9-category-card::after {
  max-height:
    100% !important;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */


@media (max-width: 1100px) {
  #app .finvia-v2-bottom {
    grid-auto-rows:
      auto !important;
  }
}


@media (max-width: 760px) {
  #app .finvia-v2-bottom
  > .card,
  #app .finvia-v2-bottom
  > article {
    width:
      100%;
  }

  #app .finvia-v9-category-card
  .finvia-v9-category-content,

  #app .finvia-v2-category-card
  .finvia-v2-category-content {
    padding-bottom:
      18px !important;
  }
}


/* NUBO_DASHBOARD_TOP3_NATURAL_V1_END */
