Module Information
Module Admin

app/modules/admin/Module.php
app/modules/admin/views/default/index.php

Create Module ASSETS in Web folder with content

app/modules/admin/web/assets/css/style.css
app/modules/admin/web/assets/js/main.js

Create Module views layouts

app/modules/admin/views/layouts/main.php

Change your Module and change layouts way in your config web.php

<?php
$config = [
'id' => 'basic',
'basePath' => dirname(__DIR__),
'bootstrap' => ['gii'],
'modules' => [
'gii' => [
'class' => 'yii\gii\Module',
'allowedIPs' => ['127.0.0.1', '::1', '192.168.0.*', '192.168.178.20'] // adjust this to your needs
],
'admin' => [
'class' => 'app\modules\admin\Module',
// the layout that should be applied for views within this module
'layout' => 'main',
],
],
...........

Create Module new assets settings class
In modules/admin directory create file AdminAsset.php with content

<?php
namespace app\modules\admin;
use yii\web\AssetBundle;

class AdminAsset extends AssetBundle
{
public $sourcePath = '@app/modules/admin/web/assets';
public $css = [
'css/style.css',
];
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
];
}

Go to your Admin Module layouts/main.php and replace your assets registration and namespace with

use app\modules\admin\AdminAsset;

AdminAsset::register($this);