#!/bin/bash
# ================================================================
# OKRFEDEF — Sprint 02: Modelo de datos completo (v2 - orden correcto)
# Ejecutar desde: /home/evolucionamos/public_html/estrategia
# Comando: bash sprint_02_migrations.sh
# ================================================================
set -e
echo "========================================="
echo "  OKRFEDEF — Sprint 02: Modelo de datos"
echo "========================================="

# Limpiar migraciones anteriores del sprint si existen
rm -f database/migrations/*create_organizations_table.php
rm -f database/migrations/*create_projects_table.php
rm -f database/migrations/*create_cycles_table.php
rm -f database/migrations/*create_objectives_table.php
rm -f database/migrations/*create_key_results_table.php
rm -f database/migrations/*create_initiatives_table.php
rm -f database/migrations/*create_dofa_factors_table.php
rm -f database/migrations/*create_dofa_sessions_table.php
rm -f database/migrations/*create_strategic_bets_table.php
rm -f database/migrations/*create_check_ins_table.php
rm -f database/migrations/*create_ai_messages_table.php
rm -f database/migrations/*create_live_sessions_table.php

BASE="database/migrations"
TS="2026_03_23"

echo ">>> Escribiendo migraciones en orden correcto..."

cat > "${BASE}/${TS}_100000_create_organizations_table.php" << 'MIGRATION'
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
    public function up(): void {
        Schema::create('organizations', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->string('logo_url')->nullable();
            $table->string('slug')->unique();
            $table->json('settings')->nullable();
            $table->boolean('active')->default(true);
            $table->timestamps();
        });
    }
    public function down(): void { Schema::dropIfExists('organizations'); }
};
MIGRATION

cat > "${BASE}/${TS}_110000_create_projects_table.php" << 'MIGRATION'
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
    public function up(): void {
        Schema::create('projects', function (Blueprint $table) {
            $table->id();
            $table->foreignId('organization_id')->constrained('organizations')->onDelete('cascade');
            $table->string('name');
            $table->text('description')->nullable();
            $table->date('period_start');
            $table->date('period_end');
            $table->enum('status', ['setup', 'active', 'closed'])->default('setup');
            $table->json('methodology_settings')->nullable();
            $table->timestamps();
        });
    }
    public function down(): void { Schema::dropIfExists('projects'); }
};
MIGRATION

cat > "${BASE}/${TS}_120000_create_cycles_table.php" << 'MIGRATION'
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
    public function up(): void {
        Schema::create('cycles', function (Blueprint $table) {
            $table->id();
            $table->foreignId('project_id')->constrained('projects')->onDelete('cascade');
            $table->tinyInteger('quarter');
            $table->year('year');
            $table->date('start_date');
            $table->date('end_date');
            $table->enum('status', ['upcoming', 'active', 'closed'])->default('upcoming');
            $table->timestamps();
        });
    }
    public function down(): void { Schema::dropIfExists('cycles'); }
};
MIGRATION

cat > "${BASE}/${TS}_130000_create_objectives_table.php" << 'MIGRATION'
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
    public function up(): void {
        Schema::create('objectives', function (Blueprint $table) {
            $table->id();
            $table->foreignId('cycle_id')->constrained('cycles')->onDelete('cascade');
            $table->string('title');
            $table->text('description')->nullable();
            $table->enum('level', ['institutional', 'area'])->default('institutional');
            $table->string('area')->nullable();
            $table->foreignId('owner_id')->nullable()->constrained('users')->nullOnDelete();
            $table->decimal('weight', 5, 2)->default(1.00);
            $table->decimal('score', 5, 4)->default(0.0000);
            $table->enum('status', ['draft', 'active', 'closed'])->default('draft');
            $table->integer('order')->default(0);
            $table->timestamps();
        });
    }
    public function down(): void { Schema::dropIfExists('objectives'); }
};
MIGRATION

cat > "${BASE}/${TS}_140000_create_key_results_table.php" << 'MIGRATION'
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
    public function up(): void {
        Schema::create('key_results', function (Blueprint $table) {
            $table->id();
            $table->foreignId('objective_id')->constrained('objectives')->onDelete('cascade');
            $table->string('title');
            $table->string('metric');
            $table->decimal('baseline', 15, 2)->default(0);
            $table->decimal('target', 15, 2);
            $table->decimal('current', 15, 2)->default(0);
            $table->string('unit')->nullable();
            $table->foreignId('owner_id')->nullable()->constrained('users')->nullOnDelete();
            $table->decimal('score', 5, 4)->default(0.0000);
            $table->enum('traffic_light', ['red', 'yellow', 'green'])->default('red');
            $table->enum('status', ['draft', 'active', 'closed'])->default('draft');
            $table->date('due_date')->nullable();
            $table->integer('order')->default(0);
            $table->timestamps();
        });
    }
    public function down(): void { Schema::dropIfExists('key_results'); }
};
MIGRATION

cat > "${BASE}/${TS}_150000_create_initiatives_table.php" << 'MIGRATION'
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
    public function up(): void {
        Schema::create('initiatives', function (Blueprint $table) {
            $table->id();
            $table->foreignId('key_result_id')->constrained('key_results')->onDelete('cascade');
            $table->string('title');
            $table->text('description')->nullable();
            $table->foreignId('owner_id')->nullable()->constrained('users')->nullOnDelete();
            $table->json('dependencies')->nullable();
            $table->date('start_date')->nullable();
            $table->date('due_date')->nullable();
            $table->enum('status', ['planned', 'active', 'done', 'cancelled'])->default('planned');
            $table->integer('progress')->default(0);
            $table->timestamps();
        });
    }
    public function down(): void { Schema::dropIfExists('initiatives'); }
};
MIGRATION

cat > "${BASE}/${TS}_160000_create_dofa_factors_table.php" << 'MIGRATION'
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
    public function up(): void {
        Schema::create('dofa_factors', function (Blueprint $table) {
            $table->id();
            $table->foreignId('project_id')->constrained('projects')->onDelete('cascade');
            $table->enum('type', ['F', 'D', 'O', 'A']);
            $table->text('description');
            $table->decimal('importance', 5, 4)->default(0);
            $table->tinyInteger('priority')->default(0);
            $table->decimal('score', 8, 4)->default(0);
            $table->tinyInteger('mefi_mefe_rating')->nullable();
            $table->decimal('mefi_mefe_weight', 5, 4)->nullable();
            $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
            $table->integer('order')->default(0);
            $table->timestamps();
        });
    }
    public function down(): void { Schema::dropIfExists('dofa_factors'); }
};
MIGRATION

cat > "${BASE}/${TS}_170000_create_dofa_sessions_table.php" << 'MIGRATION'
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
    public function up(): void {
        Schema::create('dofa_sessions', function (Blueprint $table) {
            $table->id();
            $table->foreignId('project_id')->constrained('projects')->onDelete('cascade');
            $table->json('participant_ratings')->nullable();
            $table->json('consolidated')->nullable();
            $table->decimal('mefi_total', 5, 4)->nullable();
            $table->decimal('mefe_total', 5, 4)->nullable();
            $table->decimal('score_fo', 8, 4)->nullable();
            $table->decimal('score_fa', 8, 4)->nullable();
            $table->decimal('score_do', 8, 4)->nullable();
            $table->decimal('score_da', 8, 4)->nullable();
            $table->enum('quadrant', ['offensive', 'defensive', 'reorientation', 'survival'])->nullable();
            $table->text('ai_analysis')->nullable();
            $table->enum('status', ['open', 'completed'])->default('open');
            $table->timestamps();
        });
    }
    public function down(): void { Schema::dropIfExists('dofa_sessions'); }
};
MIGRATION

cat > "${BASE}/${TS}_180000_create_strategic_bets_table.php" << 'MIGRATION'
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
    public function up(): void {
        Schema::create('strategic_bets', function (Blueprint $table) {
            $table->id();
            $table->foreignId('project_id')->constrained('projects')->onDelete('cascade');
            $table->text('hypothesis');
            $table->string('capability')->nullable();
            $table->text('renunciation')->nullable();
            $table->text('value_logic')->nullable();
            $table->text('risks')->nullable();
            $table->decimal('feasibility_avg', 4, 2)->default(0);
            $table->decimal('impact_avg', 4, 2)->default(0);
            $table->decimal('score', 4, 2)->default(0);
            $table->text('ai_validation')->nullable();
            $table->enum('status', ['proposed', 'active', 'discarded'])->default('proposed');
            $table->foreignId('proposed_by')->nullable()->constrained('users')->nullOnDelete();
            $table->timestamps();
        });
    }
    public function down(): void { Schema::dropIfExists('strategic_bets'); }
};
MIGRATION

cat > "${BASE}/${TS}_190000_create_check_ins_table.php" << 'MIGRATION'
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
    public function up(): void {
        Schema::create('check_ins', function (Blueprint $table) {
            $table->id();
            $table->foreignId('key_result_id')->constrained('key_results')->onDelete('cascade');
            $table->foreignId('user_id')->constrained('users')->onDelete('cascade');
            $table->decimal('value', 15, 2);
            $table->text('note')->nullable();
            $table->tinyInteger('week_number');
            $table->year('year');
            $table->decimal('score_at_checkin', 5, 4)->nullable();
            $table->enum('confidence', ['low', 'medium', 'high'])->default('medium');
            $table->timestamps();
        });
    }
    public function down(): void { Schema::dropIfExists('check_ins'); }
};
MIGRATION

cat > "${BASE}/${TS}_200000_create_live_sessions_table.php" << 'MIGRATION'
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
    public function up(): void {
        Schema::create('live_sessions', function (Blueprint $table) {
            $table->id();
            $table->foreignId('project_id')->constrained('projects')->onDelete('cascade');
            $table->enum('type', ['retiro1', 'retiro2', 'weekly', 'monthly', 'quarterly']);
            $table->string('current_block')->nullable();
            $table->integer('block_number')->default(0);
            $table->enum('status', ['waiting', 'active', 'paused', 'ended'])->default('waiting');
            $table->json('connected_users')->nullable();
            $table->json('session_log')->nullable();
            $table->boolean('voice_enabled')->default(true);
            $table->foreignId('facilitated_by')->nullable()->constrained('users')->nullOnDelete();
            $table->timestamp('started_at')->nullable();
            $table->timestamp('ended_at')->nullable();
            $table->timestamps();
        });
    }
    public function down(): void { Schema::dropIfExists('live_sessions'); }
};
MIGRATION

cat > "${BASE}/${TS}_210000_create_ai_messages_table.php" << 'MIGRATION'
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
    public function up(): void {
        Schema::create('ai_messages', function (Blueprint $table) {
            $table->id();
            $table->foreignId('project_id')->nullable()->constrained('projects')->nullOnDelete();
            $table->foreignId('live_session_id')->nullable()->constrained('live_sessions')->nullOnDelete();
            $table->foreignId('user_id')->nullable()->constrained('users')->nullOnDelete();
            $table->enum('module', ['dofa','bet','kr_validation','synthesis','chat','monthly','quarterly','board','voice']);
            $table->json('context')->nullable();
            $table->text('prompt');
            $table->longText('response')->nullable();
            $table->string('model')->default('claude-sonnet-4-20250514');
            $table->integer('tokens_used')->default(0);
            $table->enum('trigger', ['proactive', 'consultive'])->default('consultive');
            $table->boolean('voiced')->default(false);
            $table->timestamps();
        });
    }
    public function down(): void { Schema::dropIfExists('ai_messages'); }
};
MIGRATION

echo ">>> Escribiendo modelos..."

cat > app/Models/Organization.php << 'MODEL'
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class Organization extends Model {
    use HasFactory;
    protected $fillable = ['name','logo_url','slug','settings','active'];
    protected $casts = ['settings'=>'array','active'=>'boolean'];
    public function projects() { return $this->hasMany(Project::class); }
}
MODEL

cat > app/Models/Project.php << 'MODEL'
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class Project extends Model {
    use HasFactory;
    protected $fillable = ['organization_id','name','description','period_start','period_end','status','methodology_settings'];
    protected $casts = ['period_start'=>'date','period_end'=>'date','methodology_settings'=>'array'];
    public function organization() { return $this->belongsTo(Organization::class); }
    public function cycles() { return $this->hasMany(Cycle::class); }
    public function dofaFactors() { return $this->hasMany(DofaFactor::class); }
    public function dofaSessions() { return $this->hasMany(DofaSession::class); }
    public function strategicBets() { return $this->hasMany(StrategicBet::class); }
    public function liveSessions() { return $this->hasMany(LiveSession::class); }
    public function aiMessages() { return $this->hasMany(AiMessage::class); }
}
MODEL

cat > app/Models/Cycle.php << 'MODEL'
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class Cycle extends Model {
    use HasFactory;
    protected $fillable = ['project_id','quarter','year','start_date','end_date','status'];
    protected $casts = ['start_date'=>'date','end_date'=>'date'];
    public function project() { return $this->belongsTo(Project::class); }
    public function objectives() { return $this->hasMany(Objective::class)->orderBy('order'); }
    public function getScoreAttribute(): float {
        $objectives = $this->objectives()->get();
        if ($objectives->isEmpty()) return 0.0;
        return round($objectives->avg('score'), 4);
    }
}
MODEL

cat > app/Models/Objective.php << 'MODEL'
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class Objective extends Model {
    use HasFactory;
    protected $fillable = ['cycle_id','title','description','level','area','owner_id','weight','score','status','order'];
    protected $casts = ['score'=>'float'];
    public function cycle() { return $this->belongsTo(Cycle::class); }
    public function owner() { return $this->belongsTo(User::class,'owner_id'); }
    public function keyResults() { return $this->hasMany(KeyResult::class)->orderBy('order'); }
    public function recalculateScore(): void {
        $krs = $this->keyResults()->get();
        if ($krs->isEmpty()) return;
        $this->score = round($krs->avg('score'), 4);
        $this->save();
    }
    public function getTrafficLightAttribute(): string {
        if ($this->score >= 0.70) return 'green';
        if ($this->score >= 0.40) return 'yellow';
        return 'red';
    }
}
MODEL

cat > app/Models/KeyResult.php << 'MODEL'
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class KeyResult extends Model {
    use HasFactory;
    protected $fillable = ['objective_id','title','metric','baseline','target','current','unit','owner_id','score','traffic_light','status','due_date','order'];
    protected $casts = ['due_date'=>'date','score'=>'float'];
    public function objective() { return $this->belongsTo(Objective::class); }
    public function owner() { return $this->belongsTo(User::class,'owner_id'); }
    public function initiatives() { return $this->hasMany(Initiative::class); }
    public function checkIns() { return $this->hasMany(CheckIn::class)->latest(); }
    public function recalculateScore(): void {
        if ($this->target == $this->baseline) return;
        $raw = ($this->current - $this->baseline) / ($this->target - $this->baseline);
        $this->score = round(min(max($raw, 0), 1), 4);
        $this->traffic_light = $this->score >= 0.70 ? 'green' : ($this->score >= 0.40 ? 'yellow' : 'red');
        $this->save();
        $this->objective->recalculateScore();
    }
}
MODEL

cat > app/Models/Initiative.php << 'MODEL'
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class Initiative extends Model {
    use HasFactory;
    protected $fillable = ['key_result_id','title','description','owner_id','dependencies','start_date','due_date','status','progress'];
    protected $casts = ['dependencies'=>'array','start_date'=>'date','due_date'=>'date'];
    public function keyResult() { return $this->belongsTo(KeyResult::class); }
    public function owner() { return $this->belongsTo(User::class,'owner_id'); }
}
MODEL

cat > app/Models/DofaFactor.php << 'MODEL'
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class DofaFactor extends Model {
    use HasFactory;
    protected $fillable = ['project_id','type','description','importance','priority','score','mefi_mefe_rating','mefi_mefe_weight','created_by','order'];
    public function project() { return $this->belongsTo(Project::class); }
    public function createdBy() { return $this->belongsTo(User::class,'created_by'); }
    public function recalculateScore(): void {
        $this->score = round($this->importance * $this->priority, 4);
        $this->save();
    }
}
MODEL

cat > app/Models/DofaSession.php << 'MODEL'
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class DofaSession extends Model {
    use HasFactory;
    protected $fillable = ['project_id','participant_ratings','consolidated','mefi_total','mefe_total','score_fo','score_fa','score_do','score_da','quadrant','ai_analysis','status'];
    protected $casts = ['participant_ratings'=>'array','consolidated'=>'array'];
    public function project() { return $this->belongsTo(Project::class); }
}
MODEL

cat > app/Models/StrategicBet.php << 'MODEL'
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class StrategicBet extends Model {
    use HasFactory;
    protected $fillable = ['project_id','hypothesis','capability','renunciation','value_logic','risks','feasibility_avg','impact_avg','score','ai_validation','status','proposed_by'];
    public function project() { return $this->belongsTo(Project::class); }
    public function proposedBy() { return $this->belongsTo(User::class,'proposed_by'); }
    public function recalculateScore(): void {
        $this->score = round(($this->feasibility_avg * 0.4) + ($this->impact_avg * 0.6), 2);
        $this->save();
    }
}
MODEL

cat > app/Models/CheckIn.php << 'MODEL'
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class CheckIn extends Model {
    use HasFactory;
    protected $fillable = ['key_result_id','user_id','value','note','week_number','year','score_at_checkin','confidence'];
    public function keyResult() { return $this->belongsTo(KeyResult::class); }
    public function user() { return $this->belongsTo(User::class); }
}
MODEL

cat > app/Models/AiMessage.php << 'MODEL'
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class AiMessage extends Model {
    use HasFactory;
    protected $fillable = ['project_id','live_session_id','user_id','module','context','prompt','response','model','tokens_used','trigger','voiced'];
    protected $casts = ['context'=>'array','voiced'=>'boolean'];
    public function project() { return $this->belongsTo(Project::class); }
    public function user() { return $this->belongsTo(User::class); }
    public function liveSession() { return $this->belongsTo(LiveSession::class); }
}
MODEL

cat > app/Models/LiveSession.php << 'MODEL'
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class LiveSession extends Model {
    use HasFactory;
    protected $fillable = ['project_id','type','current_block','block_number','status','connected_users','session_log','voice_enabled','facilitated_by','started_at','ended_at'];
    protected $casts = ['connected_users'=>'array','session_log'=>'array','voice_enabled'=>'boolean','started_at'=>'datetime','ended_at'=>'datetime'];
    public function project() { return $this->belongsTo(Project::class); }
    public function facilitatedBy() { return $this->belongsTo(User::class,'facilitated_by'); }
    public function aiMessages() { return $this->hasMany(AiMessage::class); }
}
MODEL

echo ">>> Actualizando modelo User con HasRoles..."
sed -i '/use Laravel\\Sanctum\\HasApiTokens;/a use Spatie\\Permission\\Traits\\HasRoles;' app/Models/User.php
sed -i 's/use HasApiTokens, HasFactory, Notifiable;/use HasApiTokens, HasFactory, Notifiable, HasRoles;/' app/Models/User.php

echo ">>> Escribiendo seeder de roles..."
cat > database/seeders/RolesAndPermissionsSeeder.php << 'SEEDER'
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Spatie\Permission\Models\Role;
use Spatie\Permission\Models\Permission;

class RolesAndPermissionsSeeder extends Seeder {
    public function run(): void {
        app()[\Spatie\Permission\PermissionRegistrar::class]->forgetCachedPermissions();
        $permissions = [
            'manage_organization','manage_projects','manage_users',
            'facilitate_sessions','view_all_okrs','edit_okrs',
            'submit_checkins','view_own_okrs','view_board_dashboard',
            'use_ai_chat','control_voice','export_reports',
        ];
        foreach ($permissions as $perm) {
            Permission::firstOrCreate(['name' => $perm]);
        }
        $consultor = Role::firstOrCreate(['name' => 'consultor']);
        $consultor->givePermissionTo(Permission::all());
        $sponsor = Role::firstOrCreate(['name' => 'sponsor']);
        $sponsor->givePermissionTo(['view_all_okrs','edit_okrs','view_board_dashboard','use_ai_chat','export_reports']);
        $champion = Role::firstOrCreate(['name' => 'champion']);
        $champion->givePermissionTo(['view_all_okrs','submit_checkins','use_ai_chat','export_reports']);
        $owner = Role::firstOrCreate(['name' => 'owner']);
        $owner->givePermissionTo(['view_own_okrs','submit_checkins','use_ai_chat']);
        $junta = Role::firstOrCreate(['name' => 'junta']);
        $junta->givePermissionTo(['view_board_dashboard','use_ai_chat']);
        echo "Roles creados: consultor, sponsor, champion, owner, junta\n";
    }
}
SEEDER

echo ">>> Ejecutando migraciones y seeders..."
php artisan config:clear
php artisan migrate --force
php artisan db:seed --class=RolesAndPermissionsSeeder
php artisan config:cache
php artisan route:cache

echo ""
echo "========================================="
echo "  Sprint 02 completado exitosamente"
echo "  12 tablas + roles y permisos creados"
echo "========================================="
