@extends('layouts.app')

@section('content')
<div class="container-fluid">
<h2>Editar Empresa</h2>

<form action="{{ route('companies.update',$company) }}" 
      method="POST" enctype="multipart/form-data">
@csrf
@method('PUT')

<div class="mb-3">
    <label>Nombre</label>
    <input name="nombre" class="form-control" 
           value="{{ $company->nombre }}" required>
</div>

<div class="mb-3">
    <label>RFC</label>
    <input name="rfc" class="form-control" 
           value="{{ $company->rfc }}" required>
</div>

<div class="mb-3">
    <label>Email</label>
    <input name="email" type="email" class="form-control" 
           value="{{ $company->email }}" required>
</div>

<div class="mb-3">
    <label>Plan</label>
    <select name="plan" class="form-control">
        <option value="basico" {{ $company->plan=='basico'?'selected':'' }}>Básico</option>
        <option value="pro" {{ $company->plan=='pro'?'selected':'' }}>Pro</option>
        <option value="premium" {{ $company->plan=='premium'?'selected':'' }}>Premium</option>
    </select>
</div>

<div class="mb-3">
    <label>Activo</label>
    <select name="activo" class="form-control">
        <option value="1" {{ $company->activo?'selected':'' }}>Sí</option>
        <option value="0" {{ !$company->activo?'selected':'' }}>No</option>
    </select>
</div>

<div class="mb-3">
    <label>Logo (opcional)</label>
    <input type="file" name="logo" class="form-control">
</div>

<button class="btn btn-success">Actualizar</button>
<a href="{{ route('companies.index') }}" class="btn btn-secondary">Cancelar</a>

</form>
</div>
@endsection
